Problem in Smartforms - SCN
Problem in Smartforms - SCN
Problem in Smartforms - SCN
com/thread/3375711
Share 0 Tweet
problem in smartforms
This question has been Answered.
Hi all i have a smartform in which i need a requirement that if all the internal fields of the three fields(
Previous Bill, Current Bill, Cumulative Bill) remains blank,Then the first four fields( SL NO, Service
Number, Service Description, and Service Specification) also remains blank .
I have used the condition Like ,it_item-sl_no NE 0. in condition. but not getting the desired
output,please sujjest me how to get these four field also blank if
all the values related to it are blank.
Capture-SCN.PNG
68.1 K
Correct Answer
by Venkateswaran K on Jun 18, 2013 8:02 AM
Hi Sanjeev,
1. in teh Smartform - where you might have defined the TABLE where you print this service table.
Regards,
Venkat
Helpful Answers by Ravi Shankar, Mehwish Haq, Sanjeev Kumar, neha gupta, Sanjeev
Kumar, Ravi Shankar, Sanjeev Kumar, Venkateswaran K
1290 Views
Average User Rating
1 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
(0 ratings)
Hi sangeev,
or
Like (0)
Hi Ramesh i have used this too, but not getting desired result.
By doing like that, all the fields related to any vlank values gets disappeared.
Capture1-scn.PNG
48.0 K
Like (0)
Like (0)
Hi ramesh, where should i declare this.....in Global Definition or at different place, please
clear it.
Like (0)
like this
2 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
Hi Ramesh, after defining in global definition nothing changes, still i am getting problem
as i have stated in previous screenshot, one more thing, as you have shown
wa_item-pre_menge NE 0.
I have written it for all variables, like it_item-pre_amnt NE 0, it_item-curr_menge NE 0 etc
Like (0)
Arindam Mondal Jun 15, 2013 2:49 PM (in response to Sanjeev Kumar)
Hi,
Are you looping on a table to get all the values or passing that table into smartform from calling program,
Why dont you filter the items before you display like copy items from the itab passed to a Global Itab
defined in Smartform and exclude those lines and then loop and display.
Say the ITAB you pass is ITAB_DATA. Create a new one in smartform say ITAB_DATA_TEMP copy the
item from ITAB_DATA and DELETE the blank entries (Suggested copy assuming that you want to keep
the original table if not so you can delete from main table) and display.
Cheers,
Arindam
Like (0)
Hi
You have to write a Program lines code... in Main_Area row of the Main Table (Next to Header)
In that for every record, you need to check the three values and assing space to the remaining fields
accordingly.
Regards,
Venkat
Like (0)
Hi Venkat, i am doing this by calling a driver program associated with it, i have declared my fields
as it_item-pre_menge, it_item-pre_amnt.....etc for all the three field( PREVIOUS BILL, CURRENT
BILL, CUMULATIVE BILL).
Could you sujjest me how can i write code in my smartforms to check the entries in all the three
fields, and then to assign space for the variables whom i wish to be empty, (when all the three
fields contain blank values, then the fields corresponding to it gets disabled)
3 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
Ravi Shankar Jun 15, 2013 3:49 PM (in response to Sanjeev Kumar)
Hi,
Please write program lines inside loop,
IF ( itab-Previous Bill
AND itab-Current Bill
AND itab-Cumulative Bill ) IS INITIAL.
flg = 'X'.
ENDIF.
Regards,
Ravi Shankar L
Like (0)
Sanjeev Kumar Jun 17, 2013 8:34 AM (in response to Ravi Shankar)
Hi Ravi,
Hi,
i have written this code
IF ( it_item-pre_menge
AND it_item-pre_amnt
AND it_item-curr_menge
AND it_item-curr_amnt
AND it_item-cumm_menge
AND it_item-cumm_amnt ) IS INITIAL.
flg = 'X'.
ENDIF.
But i am getting this error "Relational Operator AND is not supported"
Like (0)
Sanjeev,
I would say the following work around if you face issue in AND operator.
Regards,
Venkat
Like (0)
4 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Hi Venkat,
thanks for your reply, but my issue is to ommit all those values in left hand side for which
all the six fields values are blank....as you have told why i will take a sum of all these
fields...
i am not getting your points......also this format of code is giving error of arithmatic
operation error.
Like (0)
Sanjeev Kumar Jun 17, 2013 1:40 PM (in response to Ravi Shankar)
Hi Ravi,
i have written my code as you sujjested, but it is working for all fields having any empty field, but
unfortunately its not working for those rows whome had all the three field values.
I means to say, on next page of my smartform on 7th row it has all the six field values
(pre_menge,pre_amnt, curr_menge, curr_amnt, cumm_menge, cumm_amnt), and 6th row having
blank values, but when executed it gives the result for first 5 row in which current bill is absent, but
after skipping 6th row it only printing values of 7 row and not printing any corresponding text , or S.
NO values.
Please tell me what i am doing wrong.I hv written this code and provided LV_FLAG <> 'X' in the
condition tab of each field for which i wants to print values.
lv_flag = 'X'.
ENDIF.
Like (0)
Ravi Shankar Jun 17, 2013 4:15 PM (in response to Sanjeev Kumar)
Hi Sanjeev Kumar,
My suggestion is please remove the flag check in the condition tab for printing
corresponding texts.
Your code also comes under loop you please check the following things,
1. Please do not use flag value check in corresponding texts.
2. I think you have created separate text for header and values please confirm this as
follows,
And also please check your code lines and flag set before printing the header text element.
The example I have shown here is for example it does not contain any condition tab.
5 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Regards,
Ravi Shankar L
Like (0)
Sanjeev Kumar Jun 18, 2013 7:08 AM (in response to Ravi Shankar)
Hi Ravi,
this is not working properly, after removing condition in text, i am getting like this, which is
not desired.
My requirement is to
hide all the fields for which all the six field values(pre_menge, pre_amnt, curr_menge,
curr_amnt, cumm_menge, cumm_amnt) are blank.
Yes i have used separate text to print values for Header and Item level.
But its working for inserting condition in each text, the only problem is that i get desired
output in my first page of output but its not printing the values
in S. No., Service No, Service Des, etc in my second page output.
Like (0)
Sanjeev Kumar Jun 18, 2013 7:54 AM (in response to Ravi Shankar)
Hi Ravi,
as you can see i am getting blank values in left hand side fields for which all the six field
values are there, please tell me how to resolve this problem
6 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
Ravi Shankar Jun 18, 2013 9:01 AM (in response to Sanjeev Kumar)
Hi Sanjeev,
Ignore my previous message,Now the problem you are facing if all the values like
previous bill,current bill and cummulative fields values are there than sl.no,service
no,service desc, unit and rate values are not printing.
If previous bill,current bill and cummulative fields values are not there it is not
printing it so there is no issues in this point?
Just check values for sl.no,service no,service desc, unit and rate values for other
fields are filled in internal table.
If values are filled from interface,Just put watchpoint and check where this data
have been cleared,While you have starting the loops all values are filled in internal
table?
If values are there in internal table please check condition tab whether it is getting
failed there to print the values.
Regards,
Ravi Shankar L
Like (0)
Sanjeev Kumar Jun 18, 2013 4:41 PM (in response to Ravi Shankar)
Hi Ravi,
from the stated points of post from Venkateswaran K, i am getting each field
values, the only problem i am facing is it is taking S. No. as 7 after 5 rows in first
page(it is to be 6), now only concern is that where to put my code, because this
time i have written it for separate text, but i have to write it somewhere else...So
just wana know where to put my code so that S. No get printed accordingly.
Thanks for your reply.
Like (0)
Mehwish Haq Jun 15, 2013 5:24 PM (in response to Sanjeev Kumar)
on the condition tab of text element on which you are printing SL NO, enter condition
Previous Bill <> initial
Current Bill <> initial
Cumulative Bill <> initial
Repeat the same condition on Service Number, Service Description, and Service Specification.
Regards
7 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
Sanjeev Kumar Jun 17, 2013 8:33 AM (in response to Mehwish Haq)
Hi
i have used in condition tab as
it_item-pre_menge <> INITIAL
it_item-pre_amnt <> INITIAL
it_item-curr_menge <> INITIAL
it_item-curr_amnt <> INITIAL
it_item-cumm_menge <>INITIAL
it_item-cumm_amnt <> INITIAL
for first three fields (S. No, Service No, Service No, but it disappers all the three fields values for all
those items having any one field zero, and keep those values only which all these fields are
non-zero)
My req. is that, if it finds, all the six fields values zero, then only left hand sided fields gets ommited.
(I don't have defined fields like Previous Bill, Current Bill, Cummulative Bill, i am taking the values
in my smartforms as above stated fields)
Like (0)
neha gupta Jun 17, 2013 9:33 AM (in response to Sanjeev Kumar)
Hi Sanjeev,
use program lines in starting of main area and try to write thwe below logic.
lv_flag = 'X'.
endif.
now add conditions node (having 2 options - true, false). -> In general tab put condition (for example
=> lv_flag = 'X'. )
leave true option as it is. - if your above condition got satisfied, then it will not display anything for 1st
field.
In false option - add text node which you were supposed to display for 1st field.
Thanks.
Like (0)
Sanjeev Kumar Jun 17, 2013 10:01 AM (in response to neha gupta)
lv_flag = 'X'.
ENDIF.
But it is giving error that "Incorrect logical expression: Comparison /SELECT-OPTION can only be
followed by "AND", "OR", or )"
8 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
neha gupta Jun 17, 2013 10:10 AM (in response to Sanjeev Kumar)
ENDIF.
Like (0)
Sanjeev Kumar Jun 17, 2013 12:33 PM (in response to neha gupta)
Hi Neha,
as you told ,i have done coding for that, and also wrote,LV_FLAG = 'X' in each condition
tab of each field, but unfortunately i am getting all my fields blank, although i have written
nothing in TRUE part, and written corresponding text in FALSE part, but not getting any
value in any fields.(when i writes corresponding text in TRUE part and kept FALSE part
vacant, results are abrupted).
Tell me where i am doing wrong.
lv_flag = 'X'.
ENDIF.
Like (0)
Sanjeev Kumar Jun 17, 2013 12:54 PM (in response to neha gupta)
Hi Neha,
i have done some changes, like LV_FLAG <> 'X', in the condition tab of each field, now
the smartform
is consists of 2 pages, all the fields are getting printed for first page, but in the second
page it has only
one row consisting of all the six values, so for this row it is not printing any field value.
Can you sujjest me what to do to get all these values.
(First page of smartforms consist of 5 rows for which the code are working, and from
second page of smartforms, row 6 have Blank values, so get ommited, but row 7 consist
of all the six field values, pre_menge,pre_amnt, curr_menge, curr_amnt, cumm_menge,
cumm_amnt).But for this row it is only showing values of this field and ommiting S. No,
Service No., Service Specification etc fields.
Like (0)
neha gupta Jun 17, 2013 1:26 PM (in response to Sanjeev Kumar)
Hi Sanjeev,
9 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Please place the break <sy-uname> in ur table program lines and debug the form.
There you will get to know the exact reason of failing.
If you have program lines inside the table and you placed break point there, it will
stop you line by line and page by page.
Please check.
Like (0)
Avirat Patel Jun 17, 2013 9:44 AM (in response to Sanjeev Kumar)
Hi sanjeev,
just delete the internal table where desire fields having values 0
Avirat
Like (0)
Sanjeev Kumar Jun 17, 2013 10:01 AM (in response to Avirat Patel)
Hi Virat,
i am not getting your points, please be specific and clear that where should i do that.
Like (0)
Avirat Patel Jun 17, 2013 10:39 AM (in response to Sanjeev Kumar)
your main internal table where you holds actual data that is to be print.
Avirat
Like (0)
DEVANAND D SHENOY Jun 17, 2013 1:24 PM (in response to Sanjeev Kumar)
Hope You are dealing with Table in Smart form for displaying your contents in the print.
just before the table placed in the smart form, Create a Flow Logic.
For creating a Flow Logic take the smart form in Edit mode place the cursor just above the table ->
Right click -> Create -> Flow Logic -> Program Lines
In that program lines provide your internal table and work area as the Import parameter.
after that loop your table
10 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
This will check whether the bills are initial or not if all are initial it will clear the initial fields such as serial
number, service number, service description etc and updates the table.
then delete the itab which is having service no blank(hope that for every valid line there will be a service
number or replace sevr no with a similar field). This will avoid blank line in the table.
The output will contain only valid entries having values in your bill only.
Like (0)
Hi Sanjeev,
1. in teh Smartform - where you might have defined the TABLE where you print this service table.
Regards,
Venkat
Like (1)
Hi Venkat,
thanks for your reply, i have used this method for each text field separately, now its printing
values.But a problem still arises, first page of smartform has 5 row, its printing well, but for second
page of smartform 6th row have blank values, so get ommited, but for 7 row its printing
values, but S. No. is coming as 7, although it has to be 6, so should i have to write a single code
line in betwwen Header and Main area....
One thing more that where should i have to write my single code to fetch the correct values.
11 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
Hi Venkat,
as you told, its working fine , but i am facing a problem in S. No. field, as it is printing the usual S.
No
in which the values of the fields are present. The problem is that, in first page of smartform it has 5
rows so it is printing for five rows, but in next page 6 th row have no values, so get ommited, and it
is printing
the next row value and the S. No. is 7 (it must to be 6).
In simple words the S. No. is printing those values in which data are present, but it must follow a
series.
I have taken a variable to count it increasing, but its not working.Kindly tell me what changes i have
to perform in S. No. field so that it increases outomatically for each record, not only for those
record in which it finds any values.
Like (0)
Okay,
In the Output variable for the column Sr.No use the above variable G_SRNO.
Regards,
Venkat
Like (0)
12 of 13 23-05-2014 12:23 PM
problem in smartforms | SCN http://scn.sap.com/thread/3375711
Like (0)
Share 0 Tweet
13 of 13 23-05-2014 12:23 PM