Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BDC: UNBLOCK Sales order in VKM3.

How to call the transaction of vkm3 and get the message that was successfully unblocked and transfer the message to the structure table? My code is not working, kindly check. thanks!

IMPORT:

lv_session: general flag for unblock

LV_SO_NO: SD document number

TABLE:

lt_error : bdcmsgcoll

CODE:

IF lv_session = 'X'.

PERFORM open_group.

ENDIF.

  • First Screen

PERFORM bdc_dynpro2 USING 'RVKRED04'

'1000'.

PERFORM bdc_field2 USING 'VBELN-LOW'

lv_so_no.

PERFORM bdc_field2 USING 'BDC_OKCODE'

'=ONLI'.

  • Second Screen

PERFORM bdc_dynpro2 USING 'SAPMSSY0'

'0120'.

PERFORM bdc_field2 USING 'BDC_OKCODE'

'X'.

PERFORM bdc_field2 USING 'BDC_OKCODE'

'=FREI'.

PERFORM bdc_field2 USING 'BDC_OKCODE'

'=SAVE'.

  • Third Screen

PERFORM bdc_dynpro2 USING 'SAPLSPO1'

'0100'.

PERFORM bdc_field2 USING 'BDC_OKCODE'

'=YES'.

  • Fourth Screen

PERFORM bdc_dynpro2 USING 'RVKRED04'

'1000'.

PERFORM bdc_field2 USING 'BDC_OKCODE'

'/EE'.

CALL TRANSACTION 'VKM3' USING bdcdata

MODE 'N'

MESSAGES INTO it_bdcmsgcoll.

COMMIT WORK AND WAIT.

IF sy-subrc EQ '0'.

LOOP AT it_bdcmsgcoll.

  • Fill internal table to avoid type conflict in function module

lt_errors-msgid = it_bdcmsgcoll-msgid.

lt_errors-msgnr = it_bdcmsgcoll-msgnr.

lt_errors-msgv1 = it_bdcmsgcoll-msgv1.

lt_errors-msgv2 = it_bdcmsgcoll-msgv2.

lt_errors-msgv3 = it_bdcmsgcoll-msgv3.

lt_errors-msgv4 = it_bdcmsgcoll-msgv4.

ENDLOOP.

ENDIF.

IF lv_session = 'X'.

PERFORM close_group.

ENDIF.

ENDFUNCTION.

Tags:
Former Member
Former Member replied

Hello Maui,

U can use the FM SD_ORDER_CREDIT_RELEASE to release. The tcode VKM3 calls this FM to release.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question