Skip to Content

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

FB60 Enhancement - BADI / User Exit / Substitution

I have the following requirement:

<b>When an invoice is posted using transaction FB60, based on GL Account entered, the line item text should be populated with the vendor name/number.</b>

I searched the forum and found that some of you have recommended to use 'substitutions'. But I am not familar with those and I am not sure if that will provide me a solution. An user exit or BADI would be great. Please help me out!

Thanks,

Sam

Tags:
replied

Hi

Just I said you have to define an exit like this:

- Define LIFNR as global data

DATA: LIFNR TYPE LIFNR.

FROM Z001.

DATA NAME LIKE LFA1-NAME1

IF BSEG-KOART = 'K'.

LIFNR = BSEG-LIFNR

ELSE.

IF NOT LIFNR IS INITIAL.

SELECT SINGLE NAME1 FROM LFA1 INTO NAME

WHERE LIFNR = LIFNR.

CONCATENATE LIFNR '/' NAME INTO bseg-sgtx

ENDIF.

ENDFORM.

In this case use SYST-TCODE = FB60 as prerequisite, so when the item is Vendor item you'll store the Vendor Code and if it's G/L item you'll create the text.

You can also create an substitution at the complete document, in this case:

FROM Z001 bool_data TYPE gb002_015.

DATA: LIFNR LIKE LFA1-LIFNR,

NAME LIKE LFA1-NAME1.

LOOP AT bool_data-bseg INTO bseg where KOART = 'K'.

LIFNR = BSEG-LIFNR.

EXIT.

ENDLOOP.

IF NOT LIFNR IS INITIAL.

SELECT SINGLE NAME1 FROM LFA1 INTO NAME

WHERE LIFNR = LIFNR.

LOOP AT bool_data-bseg INTO bseg where KOART = 'S'.

CONCATENATE LIFNR '/' NAME INTO bseg-sgtx

MODIFY bool_data-bseg FROM BSEG.

ENDLOOP.

ENDIF.

ENDFORM.

Max

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