Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Capturing the field value

0 Likes
1,480

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

1 ACCEPTED SOLUTION
Read only

0 Likes
1,447

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.

9 REPLIES 9
Read only

Former Member
0 Likes
1,447

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

Read only

0 Likes
1,447

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.

Read only

0 Likes
1,447

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.

Read only

0 Likes
1,447


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.

Read only

Former Member
0 Likes
1,447

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.

Read only

Former Member
0 Likes
1,447

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.

Read only

0 Likes
1,448

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.

Read only

0 Likes
1,447

thanks gaurav..:-)

Read only

0 Likes
1,447

Welcome.

If the issue has been resolved mark the correct answer and close the thread.