2006 Jun 18 1:08 PM
Hi all.
Can i declare an internal table in SAP script and update it tru subroutines. i have a specific requirements so.
Thanks in Advance.
Hi all.
Can i declare an internal table in SAP script and update it tru subroutines. i have a specific requirements so.
Thanks in Advance.
2006 Jun 18 2:42 PM
Hi Diwakar,
I don't think so.
But there is one more way to do so as to meet ur requirement as far as my understanding is concerned,
1)declare the internal table in driver program only
2)Pass the same in subroutine and let it get modified, the values will get reflected.
Hope this will help u in some way..
2006 Jun 18 3:05 PM
Hi Diwakar,
You can not declare an internal table in SAP Scripts. For this you will have to use smartforms. You have to create internal table in the print program and pass it to the script. You can access the variable by putting it in between '&', say &itab-matnr& .
Regards,
Navneeth
PS: Please reward point to all helpful answers
2006 Jun 18 6:51 PM
Hi,
just to point out the conceptual difference between SAPSCRIPT and SMARTFORMS:
Using SAPSCRIPT, you will declare the internal table in the program calling the SAPSCRIPT form.
After open and start of form, you will loop at the internal table and trigger a forms element (in window MAIN) in the form using function module WRITE_FORM for each loop.
Using SMARTFORMS, you will pass the internal table in the SMARTFORMS function interface. In the SMARTFORM, where ever you want, you declare a TABLE knot and loop at the table.
In SAPSCRIPT, you will use TABS to let the output look table-like, in SMARTFORMS you define the cell structure of an output line.
The result is comparable if not the same because SMARTFORMS internally do nothing really different from SAPSCRIPT.
The (near) future will be ADOBE-interactive forms anyway but I doubt that this is the end of the line.
Regards,
Clemens
2006 Jun 19 2:04 AM
Hi Diwakar,
try using the FM WRITE_FORM_LINES this has an internal table and it can be passed to the sap script for writing the contents of the internal table.
I have used this many times and it helps to pass an internal table contenet to the sap acript.
There is no other way to pass an internal ttable to a sapscript as it is not supported. You can alternatively use SMARTFORMS as described in above post.
Cheers
VJ
2006 Jun 19 5:53 AM
HI
GOOD
I DONT THINK YOU CAN DECLARE AN INTERAL TABLE IN THE SAP SCRIPT AND CAN UPDATE IT.
THANKS
MRUTYUN
2006 Jun 19 5:58 AM
u can't do that...
but if u don't want to change ur driver program than u can use perform in sap script.
ex-
:PERFORM get_date IN PROGRAM zreport
/:USING &SALESORDER&
/:CHANGING &S_DATE&
/:ENDPERFORM
Now you can print S_DATE.
Write this code in the new ABAP program would be
REPORT zreport.
FORM get_date TABLES in_tab STRUCTURE ITCSY
out_tab STRUCTURE ITCSY .
READ TABLE in_tab INDEX 1.
SELECT some_date FROM ztab
WHERE salesorder = in_tab-value.
IF sy-subrc EQ 0.
READ TABLE out-tab INDEX 1.
MOVE ztab-somedate TO out_tab-value
MODIFY out_tab INDEX 1.
ENDIF.
ENDFORM.
2006 Jun 19 8:23 AM
nice try. But this is not at all related to internal tables.
Regards,
Clemens
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |