‎2015 May 20 11:00 AM
hello,
i've generated a report with sales document number (VBAP-VBELN) and material number (VBAP-MATNR). but my requirement is that, whenever the value '0000004969' is displayed for VBELN, the text 'NOVALUE' should be displayed in MATNR colomn.
please help on this.
regards and thanks.
M.V.S.Rajesh
‎2015 May 20 12:39 PM
thanks nida,
"data : gt_vbap type standard table of vbap.
field-symbols : <fs_vbap> like line of gt_vbap.
Loop at Gt_vbap assigning <fs_vbap> where vbeln = '0000004969'.
<fs_vbap>-matnr = 'NOVAL'.
endloop."
is working thanks a lot.
regards.
‎2015 May 20 11:05 AM
Hi Rajesh,
Could you please elaborate the type of report that you've developed? The value of VBELN is being fetched from VBAP, isn't it?
While populating the internal table itself, you can assign NOVALUE to matnr column for the required VBELN value.
Regards
Nida
‎2015 May 20 11:28 AM
hi nida,
i've developed an alv report in grid format. as i said before, not only for the value '0000004969' but also for 3 of the values given by the Functional team like 1st - '0000004969' 2nd value - '0000004971' and the 3rd is - '0000004982'.
whenever the above values 4969, 4971, 4982 get displayed, instead of displaying the respective MATNR value, they want the text 'NOVALUE' to be displayed in the report.
regards.
‎2015 May 20 11:33 AM
Hi,
As Nida Patil said you can apply the same scenario here for all remaining material numbers while populating your internal table.
sample code
IF VBELN = '0000004969' OR VBELN = '0000004971' OR VBELN = 0000004982''
WA-MATNR = 'NOVALUE'.
ENDIF.
APPEND WA TO ITAB.
‎2015 May 20 12:43 PM
Then Try something like below.
ranges : s_vbeln for lv_vbeln.
s_vbeln-sign = 'I'.
s_vbeln-option = 'EQ'.
s_vbeln-low = '0000004969'.
append s_vbeln.
s_vbeln-low = '0000004971'.
append s_vbeln.
s_vbeln-low = '0000004982'.
append s_vbeln.
LOOP AT gt_vbap ASSIGNING <fs_vbap>.
IF <fs_vbap>-vbeln in s_vbeln.
<fs_vbap>-matnr = 'NOVAL'.
ENDIF.
ENDLOOP.
In future if they want to add more values in VBELN u can add that to ranges.
‎2015 May 20 11:13 AM
Hi Rajesh,
Check if following code helps.
loop at itab into wa where vbeln = '0000004969'.
wa-matnr = 'NOVALUE'.
modify itab from wa transporting matnr where vbeln = wa-vbeln.
endloop.
here, itab and wa are the same type as your internal table for report.
Hope it helps.
regards,
Pranav.
‎2015 May 20 11:30 AM
Hi,
Try as below.
data : gt_vbap type standard table of vbap.
field-symbols : <fs_vbap> like line of gt_vbap.
Loop at Gt_vbap assigning <fs_vbap> where vbeln = '0000004969'.
<fs_vbap>-matnr = 'NOVAL'.
endloop.
Hope this helps.
‎2015 May 20 12:39 PM
thanks nida,
"data : gt_vbap type standard table of vbap.
field-symbols : <fs_vbap> like line of gt_vbap.
Loop at Gt_vbap assigning <fs_vbap> where vbeln = '0000004969'.
<fs_vbap>-matnr = 'NOVAL'.
endloop."
is working thanks a lot.
regards.
‎2015 May 20 12:43 PM
‎2015 May 20 1:50 PM
Welcome.
If the issue has been resolved mark the correct answer and close the thread.