cancel
Showing results for 
Search instead for 
Did you mean: 

sapscript-perform?

Former Member
0 Kudos

HI FRIENDS..

in sapscript..

from driver program i send 10 material no from mara table to layout(se71 script)..

my requirement is

in layout based on the material no i have to select material description from makt using perform statement

how can i do this

please its urgentt

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Hope you're doing well!

I think here in this case there is no need of creating a separate subroutine using PERFORM statement on the layout. For getting the Material description from MAKT table...you can create an internal table of two fields..matnr and maktx.

Loop at the internl table for MARA...n get all the materials in your new created internal table...then you can get the material description from MAKT table using the following piece of code:

 
IF t_makt[] is not initial.
Select maktx from makt into correspoding fields of your new create internal table
for all entries in t_mara
where matnr = t_mara-matnr.

This will give you the material description of all the materials and that too you will hav these in one internal table..

Now..on the layout..you can use your newly created internal table as:

&your newly created internal table-maktx&

If this does not resolve your issue..then let me know i'll you another approach..

Please provide me points if this sounds helpful.

Thanks,

Shamim

Former Member
0 Kudos

my requirement similar like this..

from layout i have to pass company code based on this i have to select data from another table..

please send me the purpose of perform with code

Former Member
0 Kudos

i am customising the standard program. so instead changing the driver program,

i have to create sub program with subroutine..

so you please

Former Member
0 Kudos

Hi,

that means ..you're going to hardcode the company codes on the layout...if yes..then you can use case endcase statement and inside each company code..you can display the material description for the material.

Here is an example of using Perform statement on the layout and its subroutine in the print program or separte program:

SCRIPT

/: &TEXT& = ' '

/: PERFORM MATERIAL_DISCRIPTION IN PROGRAM ZZSDS004

/: USING &VBDPL-MATNR&

/: USING &VBDKL-VKORG&

/: USING &VBDPL-VTWEG&

/: CHANGING &TEXT&

/: ENDPERFORM

SUBROUTINE DEFINITION

  • get material number

READ TABLE in_par INDEX 1.

CHECK sy-subrc = 0.

l_f_matnr = in_par-value.

  • get sales organization

READ TABLE in_par INDEX 2.

CHECK sy-subrc = 0.

l_f_vkorg = in_par-value.

  • get distribution channel

READ TABLE in_par INDEX 3.

CHECK sy-subrc = 0.

l_f_vtweg = in_par-value.

Thanks,

Shamim

Former Member
0 Kudos

also check this web page for using PERFORM statement without making changes in the standard program:

http://help.sap.com/saphelp_47x200/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Thanks,

Shamim

Answers (0)