‎2008 Apr 17 1:20 PM
Hi,
I have creted a simple sapscript example which contains 3 windows: main, data and header. Data window displays current date, header some information like address,etc and in main I have declared an element called MAIN_ELEMENT.
I want to output BNAME,ANAME,ERDAT,LOCNT columns from USR02 table in main window.
How to do that??
Please someone help me.
Helpfull answers will be fully rewarded.
Thank you!
‎2008 Apr 17 1:28 PM
in your driver program
select BNAME,ANAME,ERDAT,LOCNT from usr02 into corresponding fields of table t_usr02 where
<your select condition>
loop at usr02.
call function write_form
element = MAIN_ELEMENT.
endloop.
in sapscript, under MAIN_ELEMENT.
&T_USR02-BNAME& &T_USR02-ANAME& &T_USR02-ERDAT& &T_USR02-LOCNT&
let me know if you need further clarification
‎2008 Apr 17 1:25 PM
well you got a driver-program for your script already?
shall the information in main window be of position type, means will there be more records to be displayed or just the data of a specific user?
‎2008 Apr 17 1:28 PM
in your driver program
select BNAME,ANAME,ERDAT,LOCNT from usr02 into corresponding fields of table t_usr02 where
<your select condition>
loop at usr02.
call function write_form
element = MAIN_ELEMENT.
endloop.
in sapscript, under MAIN_ELEMENT.
&T_USR02-BNAME& &T_USR02-ANAME& &T_USR02-ERDAT& &T_USR02-LOCNT&
let me know if you need further clarification
‎2008 Apr 17 1:41 PM
OK ... but is another solution ... with 2 internal tables(IN and OUT) type of ITCSY structure. ??? How to do in this way?
‎2008 Apr 17 2:00 PM
in ur sapscript...
PERFORM GET_userdate IN PROGRAM Z_<ur driverprogram>
USING &<if u have to send some variable to get data>&
CHANGING &BNAME&
CHANGING &var2&
ENDPERFORM
in ur program
FORM GET_USERDATA TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
READ TABLE IN_PAR WITH KEY <ur using variable>.
select data from usr02.
. READ TABLE OUT_PAR WITH KEY 'BNAME'.
IF SY-SUBRC EQ 0.
OUT_PAR-VALUE = ur bname value.
MODIFY OUT_PAR INDEX sy-tabix..
endif.
READ TABLE OUT_PAR WITH KEY 'var2'.
IF SY-SUBRC EQ 0.
OUT_PAR-VALUE = ur var2 value.
MODIFY OUT_PAR INDEX sy-tabix..
endif.
‎2008 Apr 17 2:06 PM
‎2008 Apr 17 1:28 PM
Hi,
Get all those values in different variables e.g. Say A , B , C etc
print those thru SAP Script by mentioning them under MAIN_ELEMENT &A& &B& , &C& etc.
I hope this helps,
Regards,
Raju Chitale
‎2008 Apr 17 1:29 PM
Hi,
Is your question relating to the layout or the provision of data?
The layout can be achieved by defining tabs in the paragraph format of your SAPscript and sperating the fields in the text elements with ,, (that's two commas).
Regards,
Nick