Iconet Services Ltd - SAP ABAP / SAPScript Consultant

Home Page
Company Profile
Search Internet for SAP Information
Subscribe to SAP R3 Mailing list
Sample ABAP Programs
ABAP How to
General Purpose layout set

Use PERFORM from SAPSCRIPT

/: PERFORM BIN_LOCATION IN PROGRAM Z_SAPSCRIPT_PERFORMS

/: USING &RESBD-MATNR&

/: USING &CAUFVD-IWERK&

/: USING &RESBD-LGORT&

/: CHANGING &MARD-LGPBE&

/: ENDPERFORM

------------------------------------------------------------------------------------------------------------------

REPORT z_sapscript_performs.

*----------------------------------------------------------------------

* SUBROUTINES FOR CALLING FROM SAPSCRIPTS

*-----------------------------------------------------------------------

* AUTHOR: Sheila Titchener - www.iconet-ltd.co.uk

* DATE: September 2005

*

*-----------------------------------------------------------------------

FORM bin_location TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

*-----------------------------------------------------------------------

* get default bin location from MARD for this material/plant/storage *

* location

*-----------------------------------------------------------------------

DATA: l_matnr TYPE matnr, "material

l_werks TYPE werks, "plant

l_lgort TYPE lgort, "storage location

l_lgpbe TYPE lgpbe. "bin location

* Get first parameter in input table.

READ TABLE in_tab INDEX 1.

WRITE in_tab-value TO l_matnr .

* Get second parameter in input table

READ TABLE in_tab INDEX 2.

MOVE in_tab-value TO l_werks.

* Get third parameter in input table

READ TABLE in_tab INDEX 3.

MOVE in_tab-value TO l_lgort.

* read bin location

SELECT SINGLE lgpbe INTO l_lgpbe FROM mard

WHERE matnr = l_matnr

AND werks = l_werks

AND lgort = l_lgort.

IF l_LGPBE IS INITIAL.

l_LGPBE = 'NONE'.

ENDIF.

* read & update only parameter in output table

READ TABLE out_tab INDEX 1.

out_tab-value = l_lgpbe.

MODIFY out_tab INDEX 1.

ENDFORM.

Back to How To list