GL A/C posting using BAPI_ACC_GL_POSTING_POST.

2024-01-17 09:38
文章标签 post using bapi acc gl posting

本文主要是介绍GL A/C posting using BAPI_ACC_GL_POSTING_POST.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

2006年10月21日 13:25:00
Requirement:

An interface needs to be developed to upload large journals either from a tab delimited file. Currently it's being done manually using FB50 transaction. Various Cost of Capital & Operational Property journals have to be posted at month end. A file interface needs to be developed.

Processing:

It involves following development/configurations:

  • File format determination (Required / optional fields and field checks).
  • Logical File Path configuration through transaction 'FILE'. A new physical file path should be created on operating system level or an existing one can be used if agreed. The Basis team member should create a new file path at operating system level, if required. The file path will have three directories: /GL_FILE /GL_Processed /GL_Error
  • Program Z_BAPI_GL_AC_DOC_POST needs to be developed to do the processing as described below:
    • The processing can be done in foreground as well as in background mode.
    • In case of background: File can only be read from Application Server.
    • In case of foreground: User will have an option to choose from Presentation or Application Server File.
    • Logical File Path / Name needs to be configured using FILE transaction for application server file processing. It is required to identify the Application server directory and file. Further it gives the flexibility to change the path and file name by using the transaction FILE, without making any changes to the program. It should not be hard-coded as directory structure might be different for Testing and production development servers.
    • Read the input file from presentation or application server as chosen.
    • Prepare Account doc header and detail internal tables.
    • Call 'BAPI_ACC_GL_POSTING_POST' to post the GL accounting document.
    • For application server case, Processed file can be flagged archived by using Function module DX_FILE_COPY and then it can be deleted using EPS_DELETE_FILE .
    • Error file can be created ( in /GL_Error directory for application server and with .err extension in case of PC processing ) for error records and can be re-processed after correction.
    • The list of successful and error transaction will be displayed after processing.

代码:
report z_test_bapi_gl_ac_doc LINE-SIZE 200.
*----------------------------------------------------------------------*
* Written By: Ram Manohar Tiwari
*----------------------------------------------------------------------*
* Presented By: http://www.rmtiwari.com
*----------------------------------------------------------------------*

data:
obj_type like bapiache02-obj_type,
obj_key like bapiache02-obj_key,
obj_sys like bapiache02-obj_sys,
documentheader like bapiache08,

accountgl like bapiacgl08
occurs 0 with header line,
currencyamount like bapiaccr08
occurs 0 with header line,
return like bapiret2
occurs 0 with header line,
extension1 like bapiextc
occurs 0 with header line,

t_edidd like edidd occurs 0 with header line,
bapi_retn_info like bapiret2 occurs 0 with header line.
data: error_flag.


*documentheader-obj_type = 'BKPFF'.
*documentheader-obj_key = '18000000002002004'.
*documentheader-obj_type = 'BKPFF'.
*documentheader-obj_key = '180000000010002004'.

*documentheader-obj_sys = 'RD1CLNT200'.


documentheader-username = sy-uname.
documentheader-header_txt = 'Test using BAPI'.
documentheader-comp_code = '1000'.

*documentheader-ac_doc_no
*documentheader-fisc_year = '2005'.

documentheader-doc_date = sy-datum.
documentheader-pstng_date = sy-datum.

*documentheader-trans_date
*documentheader-fis_period

documentheader-doc_type = 'SA'.


*documentheader-ref_doc_no
*documentheader-compo_acc
*documentheader-reason_rev



accountgl-itemno_acc = '1'.
accountgl-gl_account = '0000160100'.
accountgl-comp_code = '1000'.
accountgl-pstng_date = sy-datum.
accountgl-doc_type = 'SA'.
accountgl-profit_ctr = '0000010000'.
append accountgl.

accountgl-itemno_acc = '2'.
accountgl-gl_account = '0000160100'.
accountgl-comp_code = '1000'.
accountgl-pstng_date = sy-datum.
accountgl-doc_type = 'SA'.
accountgl-profit_ctr = '0000010000'.
append accountgl.


*AC_DOC_NO
*FISC_YEAR
*FIS_PERIOD
*accountgl-STAT_CON = 'X'.
*REF_KEY_1
*REF_KEY_2
*REF_KEY_3
*CUSTOMER
*VENDOR_NO
*ALLOC_NMBR
*ITEM_TEXT
*BUS_AREA
*COSTCENTER
*ACTTYPE
*ORDERID
*ORIG_GROUP
*COST_OBJ
*PROFIT_CTR
*PART_PRCTR
*WBS_ELEMENT
*NETWORK
*ROUTING_NO
*ORDER_ITNO


currencyamount-itemno_acc = '1'.
currencyamount-currency = 'GBP'.
currencyamount-amt_doccur = '100.00'.
append currencyamount.

currencyamount-itemno_acc = '2'.
currencyamount-currency = 'GBP'.
currencyamount-amt_doccur = '-100.00'.
append currencyamount.


* call BAPI-function in this system
call function 'BAPI_ACC_GL_POSTING_POST'
exporting
documentheader = documentheader
* importing
* obj_type = obj_type
* obj_key = obj_key
* obj_sys = obj_sys

tables
accountgl = accountgl
currencyamount = currencyamount
return = return
extension1 = extension1
exceptions
others = 1.
if sy-subrc >< 0.
message e999(re) with 'Problem occured'.
else.
loop at return.
if not return is initial.
clear bapi_retn_info.
move-corresponding return to bapi_retn_info.
if return-type = 'A' or return-type = 'E'.
error_flag = 'X'.
endif.
append bapi_retn_info.
endif.
endloop.
if error_flag = 'X'.
message e999(re) with 'Problem occured'.
rollback work.
else.
commit work.
endif.
endif.
来源:http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/Management/SAPCaseStudies.html



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1343984


这篇关于GL A/C posting using BAPI_ACC_GL_POSTING_POST.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/615604

相关文章

10 Source-Get-Post-JsonP 网络请求

划重点 使用vue-resource.js库 进行网络请求操作POST : this.$http.post ( … )GET : this.$http.get ( … ) 小鸡炖蘑菇 <!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-w

Unity Post Process Unity后处理学习日志

Unity Post Process Unity后处理学习日志 在现代游戏开发中,后处理(Post Processing)技术已经成为提升游戏画面质量的关键工具。Unity的后处理栈(Post Processing Stack)是一个强大的插件,它允许开发者为游戏场景添加各种视觉效果,如景深、色彩校正、辉光、模糊等。这些效果不仅能够增强游戏的视觉吸引力,还能帮助传达特定的情感和氛围。 文档

glShadeModel函数 GL_SMOOTH与GL_FLAT的区别

glShadeModel函数用于控制opengl中绘制指定两点间其他点颜色的过渡模式 参数一般为GL_SMOOTH(默认),GL_FLAT opengl默认是将制定的两点颜色进行插值,绘制之间的其他点 如果两点的颜色相同,使用两个参数效果相同 如果两点颜色不同,GL_SMOOTH会出现过渡效果,GL_FLAT 则只是以指定的某一点的单一色绘制其他所有点 如图可以对比GL_SM

项目一(一) HttpClient中的POST请求和GET请求

HttpClient中的POST请求和GET请求 一、HttpClient简述 HttpClient是Apache Jakarta Common下的子项目,用来提供高效的、最新的、功能丰富的支持HTTP协议的客户端编程工具包,并且它支持HTTP协议最新的版本和建议。HttpClient已经应用在很多的项目中,比如Apache Jakarta上很著名的另外两个开源项目Cactus和HTMLU

Post-Training有多重要?一文带你了解全部细节

1. 简介 随着LLM学界和工业界日新月异的发展,不仅预训练所用的算力和数据正在疯狂内卷,后训练(post-training)的对齐和微调方法也在不断更新。InstructGPT、WebGPT等较早发布的模型使用标准RLHF方法,其中的数据管理风格和规模似乎已经过时。近来,Meta、谷歌和英伟达等AI巨头纷纷发布开源模型,附带发布详尽的论文或报告,包括Llama 3.1、Nemotron 340

ajax xmlhttprequest使用post传参数并向后台获取数据

ajax xmlhttprequest向后台传数据有两种方式,一种是直接在地址URL后面加入参数,后台用Request.QueryString来获取,另外一种是采用POST来传,send方法发送参数对,比如send("a=3&b=4"),后台用Request.Form[“a”]来获取3,同理Request.Form["b"]获取4   前台代码: <%@ Page Titl

Flutter-使用dio插件请求网络(get ,post,下载文件)

引入库:dio: ^2.1.13可直接运行的代码:包含了post,get 下载文件import 'package:flutter/material.dart';import 'package:dio/dio.dart';void main() {runApp(new MaterialApp(title: 'Container demo',home: new visitNetPage(),)

【python 爬虫】python如何以request payload形式发送post请求

普通的http的post请求的请求content-type类型是:Content-Type:application/x-www-form-urlencoded, 而另外一种形式request payload,其Content-Type为application/json import jsonurl = 'https://api.github.com/some/endpoint'payload

Python实现requests-post(Multipart/form-data格式)boundary=----WebKitForm

这种模式相比于普通post,实在太烦了,这种基本都是用来上传文件(包括图片、excel、doc等) import requestsfrom requests_toolbelt.multipart.encoder import MultipartEncoderimport jsonurl = 'http://www.requests-post.com'headers = {'Accept':

Delphi XE10,Json 生成和解析,再利用indyhttp控件Post

--不多说,直接上代码 procedure TFrmMain.Brand; var   JSONObject, jsonparam: TJSONObject; // JSON类   jsonArray: TJSONArray; // JSON数组变量   i: Integer;   Flag_Do: Boolean;   jsonToSend: TStringStream;   jsonStr,