Application Development and Automation 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: 
Read only

Where and How can i define data statement in Sap Script.

Former Member
0 Likes
5,029

I want to define variable in sap script how can I define that?

I had written as below but its giving me error.

DEFINE V_QMATA.

PERFORM GET_QMATA IN PROGRAM ZRVADEK01 USING &VBLKP-MATNR&

USING &VBLKP-WERKS&

CHANGING &V_QMATA&.

ENDPERFORM.

IF &V_QMATA& EQ 'Z0001'.

&V_QMATA&

ENDIF.

Error:

DEFINE V_QMATA.

Symbol expected

PERFORM GET_QMATA IN PROGRAM ZRVADEK01 USING &VBLKP-MATNR&

Too many parameters

USING &VBLKP-WERKS&

CHANGING &V_QMATA&.

ENDPERFORM.

IF &V_QMATA& EQ 'Z0001'.

&V_QMATA&

Command expected

ENDIF.

I want to define variable in sap script how can I define that?

I had written as below but its giving me error.

DEFINE V_QMATA.

PERFORM GET_QMATA IN PROGRAM ZRVADEK01 USING &VBLKP-MATNR&

USING &VBLKP-WERKS&

CHANGING &V_QMATA&.

ENDPERFORM.

IF &V_QMATA& EQ 'Z0001'.

&V_QMATA&

ENDIF.

Error:

DEFINE V_QMATA.

Symbol expected

PERFORM GET_QMATA IN PROGRAM ZRVADEK01 USING &VBLKP-MATNR&

Too many parameters

USING &VBLKP-WERKS&

CHANGING &V_QMATA&.

ENDPERFORM.

IF &V_QMATA& EQ 'Z0001'.

&V_QMATA&

Command expected

ENDIF.

4 REPLIES 4
Read only

Former Member
0 Likes
1,980

Hi,

Use the statement /: DEFINE

Refer to this link..[Define a variable |]

Read only

nkr1shna
Contributor
0 Likes
1,980

HI,

While defining variables in SAPscript make sure you are following syntax

/: DEFINE <variable name>

Since you are calling SAPScript command, you must start with "/:" to specify you are calling SAPscript command

Regards

Krishna

Read only

Former Member
0 Likes
1,980

Remove the St. "DEFINE V_QMATA"

The Perform statement will take care of defination ....

Thanks,

Adi

Read only

Former Member
0 Likes
1,980

/: DEFINE &name& = 'ABAP developer'