Skip to Content
0
Former Member
May 20, 2008 at 05:51 AM

Sap Script Subroutine

12 Views

Hi Experts ,

Below is my code for sap script modification subroutine.

But its not working ...the out_par value is not reflecting to CHANGING &RET_ADRS& in form...

Please can any one tell me what is the mistake and send me the correction code.

DEFINE &RET_ADRS&

IF &PAGE& = '1'

PERFORM GET_RETURN_ADDRESS IN PROGRAM ZFI0014_EFTCHECK

USING &REGUH-LIFNR&

CHANGING &RET_ADRS&

ENDPERFORM

IF &RET_ADRS& = 'AGNT'

INCLUDE Z_RETURN_AGNT OBJECT TEXT ID ADRS

ELSE

INCLUDE Z_RETURN_AP OBJECT TEXT ID ADRS

ENDIF

Report ZFI0014_EFTCHECK .

&----


*& Form GET_RETURN_ADDRESS

&----


FORM get_return_address TABLES in_par STRUCTURE itcsy

out_par STRUCTURE itcsy.

DATA: l_begru LIKE lfa1-begru,

l_lifnr TYPE lifnr.

  • Get Vendor

READ TABLE in_par WITH KEY 'REGUH-LIFNR'.

IF in_par-value NE space.

l_lifnr = in_par-value.

SELECT SINGLE begru INTO l_begru

FROM lfa1 WHERE lifnr EQ l_lifnr.

READ TABLE out_par WITH KEY 'RET_ADRS'.

out_par-value = l_begru.

IF l_begru = 'AGNT'.

out_par-value = 'Z_RETURN_AGNT'.

ELSE.

out_par-value = 'Z_RETURN_AP'.

ENDIF.

MODIFY out_par INDEX sy-tabix.

ENDIF.

ENDFORM.

Thnx in Advance.

Venky