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

Sapscripts

Former Member
0 Likes
347

Hiii experts

I have a requirement to get the values from structure GOHEAD-BUYER but this structure is not there in Original print program . please suggest me something how to get the values or if u have any demo code for this please send

Thanx and Regards

Hitesh Batra

2 REPLIES 2
Read only

Former Member
0 Likes
321

Hi Hitesh, your question is not specific enough. But maybe you can use dynamic subroutine calling from sapscript and get the value from database instead from structure.

Read only

Former Member
0 Likes
321

hi,

you need to adapt the standard PRINT PROGRAM, for that one you work with FORM ROUTINES.

for creating FORM ROUTINE follow this sample code...

1) goto SE38

2) provide name for PROGRAM

3) provide tables work area

TABLES: GOHEAD-BUYER.

4) maintain SUBROUTINE

FORM <name> TABLES input STRUCTURE ITCSY

output STRUCTURE ITCSY.

  • here declare varibles if required

        • provide logic for getting the data

LOOP AT input.

CASE input-name.

WHEN ' ' " here condition based on your extracting data

X = input-value. " here store you required data

****based on input value extracting your required data

****logic for print output

output-name = ' ' "field which you was extracting

output-value = " specifes the field for holding the value

APPEND output.

ENDFORM.

in print program you call this subroutine, for that one you use PERFORM and ENDPERFORM control command

/: PERFORM <name> IN PROGRAM <program-name>

****here pass the parameter on which you extracting the data from table

/: USING &parameter& " based on this variable you extracting data

/: CHANGING & & " this value for print output

/: ENDPERFORM

/ .................................. " here you print the extracted data.

while working with FORM ROUTINES you must define formal parameters of type ITCSY structure. this structure has two fields NAME and VALUE.

regards,

Ashok Reddy