cancel
Showing results for 
Search instead for 
Did you mean: 

Explicit commit for BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Kudos

Hi

i am doing Webservice to RFC ..to create the Sales order..as BAPI will not support the COMMIT i wrote the RFC Programme to COMMIT EXPLICITlY...

When i tested the RFC its posting the data and i am getting the Sales Document Number..

When i tried to post the data from Webservice i am not getting any Response (i.e Sales document number) i think RFC is not Commiting ...Even i checked the Coomit Handling for Single BAPIS calls in RFC Adapter still no use ...

Any idea where i did mistake..

The RFC progrmme for Commit:

FUNCTION ZRFC_SALESORDER_CREATE.

*"----


""Local interface:

*" TABLES

*" ORDER_HEADER_IN1 STRUCTURE BAPISDHD1

*" ORDER_PARTNERS STRUCTURE BAPIPARNR

*" ORDER_ITEMS_IN STRUCTURE BAPISDITM

*" ORDER_SCHEDULES_IN STRUCTURE BAPISCHDL

*" RETURN STRUCTURE BAPIRET2

*" IT_SALES STRUCTURE VBAK

*"----


data: salesdoc type BAPIVBELN-VBELN.

data: wa_sales like line of it_sales.

clear:it_sales, wa_sales,salesdoc.

*Loop at ORDER_HEADER_IN1.

CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'

EXPORTING

  • SALESDOCUMENTIN =

ORDER_HEADER_IN = ORDER_HEADER_IN1

  • ORDER_HEADER_INX =

  • SENDER =

  • BINARY_RELATIONSHIPTYPE =

  • INT_NUMBER_ASSIGNMENT =

  • BEHAVE_WHEN_ERROR =

  • LOGIC_SWITCH =

  • TESTRUN =

  • CONVERT = ' '

IMPORTING

SALESDOCUMENT = salesdoc

TABLES

RETURN = return

ORDER_ITEMS_IN = ORDER_ITEMS_IN

  • ORDER_ITEMS_INX =

ORDER_PARTNERS = ORDER_PARTNERS

ORDER_SCHEDULES_IN = ORDER_SCHEDULES_IN

  • ORDER_SCHEDULES_INX =

  • ORDER_CONDITIONS_IN =

  • ORDER_CFGS_REF =

  • ORDER_CFGS_INST =

  • ORDER_CFGS_PART_OF =

  • ORDER_CFGS_VALUE =

  • ORDER_CFGS_BLOB =

  • ORDER_CFGS_VK =

  • ORDER_CFGS_REFINST =

  • ORDER_CCARD =

  • ORDER_TEXT =

  • ORDER_KEYS =

  • EXTENSIONIN =

  • PARTNERADDRESSES =

.

*commit work.

*endloop.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = Return

.

if sy-subrc = 0.

wa_sales-vbeln = salesdoc.

append wa_sales to it_sales[].

endif.

ENDFUNCTION

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Are you using RFC Receiver Adapter to call the RFC? If yes, you can do a commit by checking the flag "Commit Handling for Single BAPI Calls" in the advanced mode on the channel. You do not need to write a custom RFC for doing a commit.

Former Member
0 Kudos

HI Deepthi

I tried by checking the Commit ...still no use

SV

Former Member
0 Kudos

Do you want to check SM58 (TRFC Trace)? It might help.

Answers (0)