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_CUSTOMERRETURN_CREATE

Former Member
0 Kudos

Hi,

I'm facing a problem with BAPI_CUSTOMERRETURN_CREATE.

We have a standard field in VBAP-MSR_RET_REASON. Could not find a place to populate it from the BAPI. Even tried extension, it did not work.

Please share your ideas to resolve this issue.

Thanks,

Anupam

2 REPLIES 2

Former Member
0 Kudos

Create an append structure with field name MSR_RET_REASON for standard structure BAPE_VBAP. Populate the custome field


DATA lv_vpart(600)    TYPE c.
DATA x_bape_vbap type BAPE_VBAP.
DATA it_extensionin              TYPE bapiparex  OCCURS 0 WITH HEADER LINE.


* Populate Performance Start and End dates
  x_bape_vbap-MSR_RET_REASON= <VALUE>.

* Populate the structure
  CALL METHOD cl_abap_container_utilities=>fill_container_c
    EXPORTING
      im_value               = x_bape_vbap
    IMPORTING
      ex_container           = lv_vpart
    EXCEPTIONS
      illegal_parameter_type = 1
      OTHERS                 = 2.

it_extensionin-structure = 'BAPE_VBAP'.
it_extensionin-valuepart1     = lv_vpart+0(240).
append it_extensionin.

With your other fields call the BAPI BAPI_CUSTOMERRETURN_CREATE, for parameter EXTENSIONIN pass the above populate internal table. Standard program will populate to VBAP table.

For reference check include program LVBAK001, subroutine MAP_VBAP_TOBAPISDIT.

Former Member
0 Kudos

VBAPKD needs to be appended as well.