Skip to Content

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

RRI with BAPI

Hello,

I want to create custom field mapping for RRI and use BAPI.

I came to se19 and created BAPI Add-in. But how and where to put ABAP code?

Thanks

Former Member
replied

Hi,

1. Go to SE19, press change button

2. Choose interface tab

3. Double click apropriate exit (EXIT_SAPLRSBBS_001 or EXIT_SAPLRSBBS_002)

4. Write your code in method implementation

5. check your code and activate it (don't forget to activate whole BAdi on initial screen of SE19 transaction)

For example I used following code in order to map months range into day range:

DATA: I_THX_MAPPING_WA TYPE LINE OF RSBBS_THX_MAPPING,
      E_THX_MAPPING_WA TYPE LINE OF RSBBS_THX_MAP_BY_EXIT,
      I_RANGE TYPE RRRANGESID,
      I_DATE LIKE SY-DATUM,
      E_TT(2).

IF I_S_RECEIVER-RONAM = 'KSB1'.
  E_THX_MAPPING_WA-FIELDNM_TO = 'BUDAT'.
  E_THX_MAPPING_WA-FIELDTP_TO = RSBBS_C_FIELDTP-OLTP.
  E_THX_MAPPING_WA-DTELNM = 'CO_BUDAT'.
  E_THX_MAPPING_WA-DOMANM = 'DATUM'.

  READ TABLE I_THX_MAPPING INTO I_THX_MAPPING_WA
       WITH KEY FIELDNM = 'SPMON'.
  IF SY-SUBRC = 0.
    LOOP AT I_THX_MAPPING_WA-RANGE INTO I_RANGE.
      I_RANGE-OPT = 'BT'.
      CONCATENATE I_RANGE-LOW '01' INTO I_RANGE-LOW.

      IF NOT I_RANGE-HIGH IS INITIAL.
        CONCATENATE I_RANGE-HIGH '01' INTO I_RANGE-HIGH.
        I_DATE = I_RANGE-HIGH.
      ELSE.
        I_DATE = I_RANGE-LOW.
      ENDIF.
      CALL FUNCTION 'END_OF_MONTH_DETERMINE_2'
        EXPORTING
          I_DATUM        = I_DATE
        IMPORTING
          E_TT           = E_TT.

      IF NOT I_RANGE-HIGH IS INITIAL.
        CONCATENATE I_RANGE-HIGH(6) E_TT INTO I_RANGE-HIGH.
      ELSE.
        CONCATENATE I_RANGE-LOW(6) E_TT INTO I_RANGE-HIGH.
      ENDIF.
      APPEND I_RANGE TO E_THX_MAPPING_WA-RANGE.
    ENDLOOP.

    INSERT E_THX_MAPPING_WA INTO TABLE E_THX_MAPPING.
  ENDIF.
ENDIF.

regards

Krzys

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