Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI in VA02 transaction

Former Member
0 Kudos

Hi All,

I have a requirement to "Remove the Billing Block u2018ZCu2019 (Check Core Part Return) and save the document" to be done VA02 transaction. Any one please tell me the BAPI for this.

Thanks in Advance,

Neethu.

6 REPLIES 6

Former Member
0 Kudos

Hi Neethu,

Try this BAPI 'BAPI_SALESORDER_CHANGE'

LOOP AT ITAB. AT NEW VBELN. REFRESH: ORDER_ITEM_IN, ORDER_ITEM_INX. ENDAT. WA_ITAB = ITAB. ORDER_ITEM_IN-ITM_NUMBER = ITAB-POSNR. ORDER_ITEM_IN-BILL_DATE = ITAB-EDATU. APPEND ORDER_ITEM_IN. ORDER_ITEM_INX-ITM_NUMBER = ITAB-POSNR. ORDER_ITEM_INX-UPDATEFLAG = 'U'. ORDER_ITEM_INX-BILL_DATE = 'X'. APPEND ORDER_ITEM_INX. AT END OF VBELN. CALL FUNCTION 'BAPI_SALESORDER_CHANGE' EXPORTING SALESDOCUMENT = ITAB-VBELN ORDER_HEADER_INX = ORDER_HEADER_INX SIMULATION = SIMULATION TABLES RETURN = RETURN ORDER_ITEM_IN = ORDER_ITEM_IN ORDER_ITEM_INX = ORDER_ITEM_INX. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' IMPORTING RETURN = WA_RETURN. LOOP AT RETURN INTO WA_RETURN. IF WA_RETURN-TYPE = 'E' OR WA_RETURN-TYPE = 'I' OR WA_RETURN-TYPE = 'W' OR WA_RETURN-TYPE = 'A'. CONCATENATE WA_RETURN-TYPE ':' WA_RETURN-MESSAGE INTO WA_RETURN-MESSAGE. CONCATENATE WA_ITAB-MSG WA_RETURN-MESSAGE INTO WA_ITAB-MSG SEPARATED BY '/'. ENDIF. ENDLOOP. IF NOT WA_ITAB-MSG IS INITIAL. MODIFY ITAB FROM WA_ITAB. ENDIF. ENDAT. ENDLOOP.

Regards

Krishna

0 Kudos

Hi Krishna,

Can you please tell me like which part of your code is used to Remove the Billing Block.

I am using BAPI for the first time, so dont have much idea.

Thanks,

Neethu.

Former Member
0 Kudos

Hi neetu,

let me tell u the easiest way to find a BAPI related to a tcode.

steps:

1.get the std program for the tcode like VA02.

2. get the corresponding package for it.

3. in se80 goto application-hierarchy->under that select function module->select the functional Module->select the package->now u shall c a list of BAPI and FM avaliable in VA02.

select the needed one from the list.

hope this helps....

thanks

ravi

Former Member
0 Kudos

Hi,

you can write the code to remove billing block in the user_exit_save,it is easy when compared to

BAPI.

Thanks & Regards,

Sateesh.

Former Member
0 Kudos

Hi,

Pass ORDER_ITEM_IN-BILL_BLOCK = ' 'befroe calling BAPI

ORDER_ITEM_IN is a type of structure

of BAPISDITM

Reagrds

Krishna

0 Kudos

Thanks Krishna, I got it.