on 08-10-2010 2:48 PM
Hi all,
Here I need to print text depending on condition satisfied.print this &GS_IT_GEN-SHORT_TEXT& or print this &gwa_equi-groes& &gwa_equi-herst& &gwa_t370k-eartx&.how to use variable in smartform and print program to print either of the text.if possible provide sample code to achieve this.as i am new to form printing section i don't know much about it's programming.
Thanks in advance.
Regards,
Harshada
Hi,
you can define variables in the Global definitions node,
and we can create program lines in the smartform and in that program lines you can write ABAP code,
so, here based on the conditions we can assign. for eg:
l_var1 should be defined in the global definitions node.
if condiion 1.
l_var1 = g_value1.
elseif condition 2.
l_var1 = g_value2
endif.
and then you can print &l_var1&.
Edited by: Radha Vineela Aepuru on Aug 10, 2010 4:10 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for quick response.here i have defined variable lv_ref type i ,in global definitions.and written code in program lines as follows.
first i am reading data from internal table.
IF SY-SUBRC = 0.
LV_REF = 1.
ELSE.
LV_REF = 0.
ENDIF.
is it necessary to make changes in print program also?
regards,
Harshada
Hi..
You need to do this process either in the print program or in the smartform.
If feasible you try to use these conditions and populate these conditions based fields while populating the final internal table that you are passing into the smartform.
Else, in smartform you can do this while reading or looping the internal table.
But its is important that the internal table or whichever is containing the value is passed into the smartform through the interface i.e. the data based on which you are doing all the process.
Regards,
Karthik
Hi..
If you need to print either of two texts then you can use an Alternative Node in Flow Logic which decides on whether the provided condition is true or not.
If there are more options out of which one needs to be printed at some cell, then you can create all the required texts put the applicable condition for their printing in the text element's Condition tab. Do it this way only if the the options have different data types.
However if they have same type, you can use a single variable in a text element, create a Program Line just above that, and depending upon the conditions, you can assign a particular fields value to the variable in text element. (As you normally do in ABAP code)
Hope this solves.
Regards,
Karthik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.