on 11-02-2007 8:28 AM
Hi all,
I'm using program RFKORD50 to print customer invoices. For this I have made a copy of the form F140_DOCU_EXC_02 (Customer Invoice), and added this to the form set in RFKORD50.
I would like to add some additional information in this Z-form, data which is not passed from the application program. Is it possible to add some program lines to the Z-form which can retrieve the additional data, or handle this in any other way without changing the application program itself?
All helpful answers will be rewarded!
Regards,
M.V.
You can use subroutine call inside your Form for getting additional information... there is no need of modify your driver program.
Ex:
/: PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
/:USING &<field name>&
/:CHANGING &<field name1&
/:ENDPERFORM
Then create subroutine pool program and you have to write the code.
FORM ><subroutine name> tables int_cond structure itcsy
outt_cond structure itcsy.
data : value(20), value1(20). "do your own declarations
Read int_cond table index 1.
value = int_cond-value.
value1 = value1 + value.
Read outt_cond table index 1.
outt_cond-value = value1.
Modify outt_cond index 1.
ENDFORM.
Just rough idea given above.
Regards,
Sairam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sairam,
Thanks for your reply - this was very helpful!
The subroutine returns an itab of text lines:
/:PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
/:USING &<field>&
/:CHANGING &<table>&
/:ENDPERFORM
How do I...?
a) declare the internal table in the script code?
b) loop and display the contents of this itab in the script code?
I will reward more points!
Regards,
M.V.
I am sorry to say that SAPscript sub-routine cannot return more then one value, and also there is no option of looping internal table inside SAPscript. Only way to acheive this(i.e multiple values) using SAPscript is to modify the driver program. Now, no other option available for you except to modify the print program.
Note: this kind of scenarios can be overcome in smartforms(i.e without modifying the driver program)..
Close the thread once your question is answered.
Regards,
SaiRam
Hi,
While the ABAP subroutine considers this a table, the SAPscript does not, so you don't need to declare a table in the form, just list the fields. E.g.
/:PERFORM <Subroutine name> IN PROGRAM <subroutine prog name>
/:USING &FIELD1& &FIELD2& etc...
/:CHANGING &FIELD_A& &FIELD_B& etc...
/:ENDPERFORM
Regards,
Nick
Hi,
Well, the CHAR element is the default, SAPscript can only define character type fields. The full syntax is
/: DEFINE &FIELD& = 'value'
Now you'll actually be setting the value in your ABAP, and this will dictate the length, so in theory you could use,
/: DEFINE &FIELD& = '1234567890'
or I guess
/: DEFINE &FIELD& = ' '
It may be worth a bit of trial and error to see which makes most sense.
Regards,
Nick
Hi,
Certainly possible. Take a look at the online help for the SAPscript command PERFORM which explains this in better detail than I possibly could.
Regards,
Nick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.