Application Development and Automation 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: 
Read only

bapi

Former Member
0 Likes
660

Hi Please suggest me how to capture messages into return parameter and wt I need to pass into FM bapi_transaction_commit i.e wt all things need to be uncommented .

This is the coding iam using here :

DATA: salesdocument like BAPIVBELN-VBELN.

DATA: i_schdule type standard table of BAPISCHDL, " for gl date & load date

i_schdulex type standard table of BAPISCHDLX, " for partner role and partner function.

i_partner type standard table of BAPIPARNR,

i_partnerx type standard table of BAPIPARNRC,

i_return type standard table of BAPIRET2 with header line.

DATA: wa_schdule Like BAPISCHDL,

wa_schdulex Like BAPISCHDLX,

wa_partner Like BAPIPARNR,

wa_partnerx Like BAPIPARNRC,

wa_simulation like BAPIFLAG, " for simulation

wa_dlvblock like BAPISDH1, " for lifsk field

wa_dlvblockx like BAPISDH1X. " for update indicator

salesdocument = WA_HEADER_BAPI-VBELN.

  • Header

wa_dlvblock-DLV_BLOCK = wa_header_bapi-lifsk. " Delivery block

  • header X

wa_dlvblockX-DLV_BLOCK = 'X'. " Delivery block

wa_dlvblockX-UPDATEFLAG = 'U'.

  • simulation flag

wa_simulation-BAPIFLAG = 'U'.

  • IF NOT i_header_bapi IS INITIAL.

LOOP AT I_HEADER_BAPI INTO WA_HEADER_BAPI.

move WA_HEADER_BAPI-WADAT to wa_schdule-gi_date.

move WA_HEADER_BAPI-lddat to wa_schdule-load_date.

move WA_HEADER_BAPI-PARVW to wa_partner-PARTN_ROLE.

MOVE WA_HEADER_BAPI-KUNNR TO wa_partner-PARTN_NUMB.

append wa_schdule to i_schdule.

append wa_partner to i_partner.

CLEAR WA_HEADER_BAPI.

CLEAR I_HEADER_BAPI.

ENDLOOP.

wa_schdulex-UPDATEFLAG = 'U'.

wa_schdulex-gi_date = 'X'.

wa_schdulex-load_date = 'X'.

append wa_schdulex to i_schdulex.

wa_partnerx-UPDATEFLAG = 'U'.

wa_partnerx-PARTN_ROLE = 'X'.

wa_partnerx-P_NUMB_NEW = 'X'.

append wa_partnerx to i_partnerx.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

EXPORTING

salesdocument = salesdocument

ORDER_HEADER_IN = wa_dlvblock

order_header_inx = wa_dlvblockX

SIMULATION = wa_simulation

  • BEHAVE_WHEN_ERROR = ' '

  • INT_NUMBER_ASSIGNMENT = ' '

  • LOGIC_SWITCH =

  • NO_STATUS_BUF_INIT = ' '

tables

return = i_return[]

  • ORDER_ITEM_IN =

  • ORDER_ITEM_INX =

PARTNERS = i_partner

PARTNERCHANGES = i_partnerx

  • PARTNERADDRESSES =

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CFGS_BLOB =

  • ORDER_CFGS_VK =

  • ORDER_CFGS_REFINST =

SCHEDULE_LINES = i_schdule

SCHEDULE_LINESX = i_schdulex

  • ORDER_TEXT =

  • ORDER_KEYS =

  • CONDITIONS_IN =

  • CONDITIONS_INX =

  • EXTENSIONIN =

.

IF SY-SUBRC EQ 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

  • IMPORTING

  • RETURN =

.

ENDIF.

6 REPLIES 6
Read only

Former Member
0 Likes
621

So where is Manas?

pk

Read only

0 Likes
621

PLEASE Stpo giving answers to this forum.

This thread is cpoy of mine,.

Read only

0 Likes
621

he will join , but not here but some where else...

Read only

0 Likes
621

Looks like the function of "P" "O" and "T" are swapped from your keyboard.

Read only

0 Likes
621

hahaa..Nice Finding Amit

Read only

Former Member
0 Likes
621

U need not pass parameters to this BAPI_TRANSACTION_COMMIT. It will comit the wrk done by ur above BAPI.