cancel
Showing results for 
Search instead for 
Did you mean: 

Sapscript define giving problem

Former Member
0 Kudos

Hi ,

I am using the define statement in combination with perform in my sap script

like /: DEFINE &OBJECT& = 'QMSM'

then the perform comes like

PERFORM GET_SAP_SCRIPT PROGRAM zTEXTS

USING &OBJECT&

CHANGING &TEXT&

report ztext.

form get_sap_script TABLES in_tab STRUCTURE ITCSY

out_tab STRUCTURE ITCSY .

.

.

.

.

now when the debugger reaches in side the form in the program

the values of in_tab is expected as in_tab-name = OBJECT

and in_tab-value = 'QMSM'

but it is coming like

in_tab-name = OBJECT

in_tab-value = Object....

maybe something silly from my side...

kindly help..

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Guys ,

I got it .....I think I was using a reserved word 'object' as the variable name that's why system was filling the value in it and overriding the value which I was providing .

Silly thing you

former_member366527
Active Participant
0 Kudos

Congratulations. Peter

Former Member
0 Kudos

Hi,

If answers are helpful reward with some points apart from THANKS .. :).

Br,

Laxmi.

Former Member
0 Kudos

Of course Laxmi I will do that(points) .. along with thanks

Former Member
0 Kudos

Hi,

check by mistake you may be overtime the OBJECT value before calling the perform. read the In_tab based on a condition and check the value.

Br,

Laxmi.

former_member366527
Active Participant
0 Kudos

Hi,

YOUR FORM:

...

Element YOURELEMENT

/: DEFINE &OBJECT& = 'QMSM'

/: PERFORM GET_SAP_SCRIPT IN PROGRAM ZTEXTS

/: USING &OBJECT&

/: CHANGING &TEXT&

/: ENDPERFORM

...

YOUR PROGRAM:

REPORT ztext.

...

&----


*& Form GET_NAME

&----


FORM get_sap_script TABLES in_tab STRUCTURE itcsy

out_tab STRUCTURE itcsy.

  • read first line of in_tab

READ TABLE in_tab INDEX 1.

  • select from z_your_table and modify out_tab with new data

SELECT SINGLE * FROM z_your_table

WHERE xx = in_tab-value(8).

IF sy-subrc = 0.

READ TABLE out_tab INDEX 1.

MOVE z_your_table-name TO out_tab-value.

MODIFY out_tab INDEX sy-tabix.

ELSE.

READ TABLE out_tab INDEX 1.

MOVE 'no name' TO out_tab-value.

MODIFY out_tab INDEX sy-tabix.

ENDIF.

ENDFORM. " get_sap_script

Hope it helps, if not, write again.

Regards,

Peter

Former Member
0 Kudos

Hi,

Then may be the problem is elsewhere Ill check and get back .

thanks for the help guys