Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Re: Passing Reason Code by using bapi BAPI_ACC_DOCUMENT_POST

$
0
0

Hi Rajendra,

 

I am assuming that due to the config of the GL account, it is asking for reason code otherwise reason code is not mandatory for this BAPI. Anyawy, to achieve what you are looking for, you have to first implement this BTE "BTE RWBAPI01". There are a lot of instructions on net on how to implement this BTE so you can figure it out from there, I will stick to the BAPI.

 

To pass the reason code, in your program you have to create a table for extension just like the tables for vendor, accountgl etc. Then you must concatenate and append the item number and reason code to "Field1" field of extension.

 

Eg: CONCATENATE lv_item_num 'XXX' INTO ls_extension-field1.

      APPEND lls_extension TO lt_extension.

 

Now when you run the BAPI using this table, the data will be captured in the Z function module you would have created for implementing the BTE. There you have to write the second piece of code.

 

Eg: LOOP AT lt_extension INTO wa_extension.

              READ it_accit WITH KEY POSNR = wa_extension+0(2).

              IF sy-subrc EQ 0.

                  

                    it_accit-rstgr = wa_extension+2(3).

                    MODIFY it_accit INDEX sy-tabix.

 

              ENDIF.

      ENDLOOP.

 

This should get the job done. Please note that the code snippet above is a pseudo code. Check all the fields and variables carefully and work accordingly.

 

Thanks,

Soumyajit


Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>