‎2007 Jul 04 6:33 AM
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
‎2007 Jul 04 7:10 AM
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.
‎2007 Jul 04 7:49 AM
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 ¶meter& " 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