Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Query with SPASCRIPT parameters

Former Member
0 Kudos

Hi Champs,

I am creating a SAP SCRIPT which will be clone of MR_PRINT and will be driven by TCode MR90. Hence I cannot make changed in the driver program.

In my requirement I need one more field to be represented in my SAP Script that is VTEXT(payment terms) field of LFM1. But when I debug the existing MR_PRINT SAPSCRIPT it seems as if there is no parameter like LFM1-VTEXT.

My Query is is it possible to create your own parameter in SAP Script and then Populate it.

I know there a syntax

  • /: DEFINE &lfm1-vtext& *

But can this varibale be used for display purpose.

Thanks

Regards

Nishant

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Nishant,

you can add your desired field in SAPACRIPT.

you need to write subroutine program for this.

e.g.

perform get_quant_char in ZMM_TRANSFER_ORDER using intab structure itscy.

FORM GET_QUANT_CHAR TABLES INTAB STRUCTURE ITCSY

OUTTAB STRUCTURE ITCSY.

DATA : QUANT(13) TYPE C,

QUANT1 TYPE I.

READ TABLE INTAB INDEX 1.

QUANT1 = INTAB-VALUE .

QUANT = QUANT1.

CONDENSE QUANT.

READ TABLE OUTTAB INDEX 1.

OUTTAB-VALUE = QUANT.

MODIFY OUTTAB INDEX 1.

ENDFORM. "Get_quant_Char

Regards,

Vijay

4 REPLIES 4

Former Member
0 Kudos

Hi Nishant,

you can add your desired field in SAPACRIPT.

you need to write subroutine program for this.

e.g.

perform get_quant_char in ZMM_TRANSFER_ORDER using intab structure itscy.

FORM GET_QUANT_CHAR TABLES INTAB STRUCTURE ITCSY

OUTTAB STRUCTURE ITCSY.

DATA : QUANT(13) TYPE C,

QUANT1 TYPE I.

READ TABLE INTAB INDEX 1.

QUANT1 = INTAB-VALUE .

QUANT = QUANT1.

CONDENSE QUANT.

READ TABLE OUTTAB INDEX 1.

OUTTAB-VALUE = QUANT.

MODIFY OUTTAB INDEX 1.

ENDFORM. "Get_quant_Char

Regards,

Vijay

0 Kudos

Hi Vijay,

Thanks for reply, but my query is the same

' The value of the OUTAB-VALUE has to be Defined in the SAPSCRIPT so that it can be displayed'

So how to define that variable, and will we be able to display that varible.

Thanks,

Regards,

Nishant

0 Kudos

Hi Nishant again,

/:DEFINE V_BANKL.

/:DEFINE V_BANKN_H.

/:DEFINE V_BANKN_L.

/:PERFORM GET_QUANT_CHAR IN PROGRAM ZTRANSFER_ITCSY

/:USING &REGUH-HKTID&

/:USING &REGUH-HBKID&

/:CHANGING &V_BANKL&

/:CHANGING &V_BANKN_L&

/:CHANGING &V_BANKN_H& .

/:ENDPERFORM.

after this you can use variable &V_BANKL& for your script.

I hope your doubt is pretty clear now.

Regards,

Vijay

0 Kudos

Thanks Vijay.

I think that will work.

Thanks a lot.

Regards,

Nishant