When Automatic Payment Program is run (T.Code F110), the Text fields in Vendor Line should have "Payment" written and G/L Line should display the Vendor Name.
In Tcode - OBBH
Make a substitution rule with prerequisite -
Transaction code F110 (BKPF-TCODE = F110)
Subsitiution - Exit on BSEG-SGTXT and call U903.
Go to program RGGBS000 and modify it.
Add the following code to the form get_exit_titles
EXITS-NAME = 'U903'.
EXITS-PARAM = C_EXIT_PARAM_NONE.
EXITS-TITLE = 'Vendor and G/L Line'.
APPEND EXITS.
and
Create a form below-
FORM U903.
DATA: L_NAME TYPE LFA1-NAME1.
DATA: V_LIFNR TYPE LFA1-LIFNR.
DATA: V_BELNR TYPE BKPF-BELNR.
IF BSEG-KOART EQ 'K'.
BSEG-SGTXT = 'PAYMENT'.
V_LIFNR = BSEG-LIFNR.
EXPORT V_LIFNR TO MEMORY ID 'LIFNR'.
ENDIF.
IF BSEG-KOART EQ 'S'.
IMPORT V_LIFNR FROM MEMORY ID 'LIFNR'.
SELECT SINGLE NAME1 INTO L_NAME FROM LFA1 WHERE
LIFNR = V_LIFNR.
IF SY-SUBRC = 0.
MOVE L_NAME TO BSEG-SGTXT.
ENDIF.
FREE MEMORY ID 'LIFNR'.
ENDIF.
ENDFORM. "U903
In Tcode - OBBH
Make a substitution rule with prerequisite -
Transaction code F110 (BKPF-TCODE = F110)
Subsitiution - Exit on BSEG-SGTXT and call U903.
Go to program RGGBS000 and modify it.
Add the following code to the form get_exit_titles
EXITS-NAME = 'U903'.
EXITS-PARAM = C_EXIT_PARAM_NONE.
EXITS-TITLE = 'Vendor and G/L Line'.
APPEND EXITS.
and
Create a form below-
FORM U903.
DATA: L_NAME TYPE LFA1-NAME1.
DATA: V_LIFNR TYPE LFA1-LIFNR.
DATA: V_BELNR TYPE BKPF-BELNR.
IF BSEG-KOART EQ 'K'.
BSEG-SGTXT = 'PAYMENT'.
V_LIFNR = BSEG-LIFNR.
EXPORT V_LIFNR TO MEMORY ID 'LIFNR'.
ENDIF.
IF BSEG-KOART EQ 'S'.
IMPORT V_LIFNR FROM MEMORY ID 'LIFNR'.
SELECT SINGLE NAME1 INTO L_NAME FROM LFA1 WHERE
LIFNR = V_LIFNR.
IF SY-SUBRC = 0.
MOVE L_NAME TO BSEG-SGTXT.
ENDIF.
FREE MEMORY ID 'LIFNR'.
ENDIF.
ENDFORM. "U903
No comments:
Post a Comment