09-05-2012 2:33 PM
Hi Experts,
Would like to seek for your advice. If the variable equals to zero it should not show anything in the table column in screen '0200'. I've tried to modify the table as below before passing it to be displayed in the screen. Somehow it still shows zero in the screen '0200'. Please help me. Thanks.
TYPES: BEGIN OF ty_receive,
qty(13) TYPE n.
END OF ty_receive.
DATA: lt_receive TYPE STANDARD TABLE OF ty_receive,
wa_receive LIKE LINE OF lt_receive.
LOOP at lt_receive INTO wa_receive.
IF wa_receive-qty = 0.
WRITE wa_receive-qty TO wa_receive-qty NO-ZERO.
ENDIF.
MODIFY lt_receive FROM wa_receive.
ENDLOOP..
Regards,
Por Shen
09-05-2012 2:52 PM
Hi
based on your condition why dont you make field wa_receive-qty = ' '. So there will be no value stored.
09-05-2012 3:00 PM
Hi,
I've tried this way too. However it still shows zero in table column at screen '0200'. Please help.
09-05-2012 3:24 PM
Hi,
What do you mean by table? I assume you're using a table control?
Did you generate this? If you did, did you use the variables lt_receive and wa_receive for table and workarea in the generation wizard?
Wizard:
This piece of code shows below screen:
TYPES: BEGIN OF ty_receive,
qty(13) TYPE n,
END OF ty_receive.
DATA: lt_receive TYPE STANDARD TABLE OF ty_receive,
wa_receive LIKE LINE OF lt_receive,
ok_code type sy-ucomm.
wa_receive-qty = 12.
append wa_receive to lt_receive.
wa_receive-qty = 0.
append wa_receive to lt_receive.
wa_receive-qty = 12.
append wa_receive to lt_receive.
call screen 1979.
Rgds,
Jeroen
09-05-2012 3:47 PM
Hi,
I create the table control manually using screen painter without using the table control wizard. The screen shot in your reply is exactly what I'm looking for. Is it possible to do show the screen shot output without using table control wizard? I've tried to play around with my coding and nothing seems to work from myside. Please advice me. Thanks.
09-05-2012 4:06 PM
Hi,
Try to use the wizard, it's very easy! Speaks for itself.
Also without using the wizard you should get this working.
The reason that it shows differently is because of the way the field is defined on the screen and not how the field is defined in the table. Check the screenfield definition, is it defined as WA_RECEIVE-QTY? If you double click and check the attributes, does it show NUMC as format? Or did you use something else on the screen definition?
Kind Regards,
Jeroen
09-05-2012 5:40 PM
Hi,
i think there are three possibilities
1)use NUMC OR C instead of N
2)
Before displaying the filed in table convert field in to character,character accept blanks,you have to do this in PBO event
3)check screen field data type in screen painter where value is displayed.
if helpful please give reward point.
Warm Regards!!!
Jenish Tailor