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

value checking

Former Member
0 Likes
393

hai,

in report program i am using function module in alv grid control.

in o/p i want to check the condition.

Check the Material Status PSTAT u2013 MARA. It should have (B-Accounting, E-Purchasing, V-Sales, G-Costing & D-MRP)

those fields only display in pstat.

i am using cs for it.

but donot how check it.

for detail i giving ex:

pstat:

1)adretvd

2)kc

3)bess

4)erev

5)sef

6)vd

7)vegsb

here o/p 7 given.

check the order b,e ,v, g,&d.

i.e i want get o/p

1, 3,4 ,5&6.

here checking should be order B,E,V,G & D.

SO, PLEASE MESSAGE ME.

thanks u.

2 REPLIES 2
Read only

BGarcia
Active Contributor
0 Likes
356

Hello Suresh.

You can use the operator CA for this.

Here's a small example using a IF statement for three of your conditions (variable lv_values contains all possible character values):


DATA: lv_values TYPE STRING VALUE 'BEVGD'.
DATA: lv_1 TYPE STRING VALUE 'ADRETVD'.
DATA: lv_2 TYPE STRING VALUE 'KC'.
DATA: lv_3 TYPE STRING VALUE 'BESS'.

IF lv_1 CA lv_values.
  WRITE: / lv_1.
ENDIF.

IF lv_2 CA lv_values.
  WRITE: / lv_2.
ENDIF.

IF lv_3 CA lv_values.
  WRITE: / lv_3.
ENDIF.

All you have to do is loop into the conditions, and extracts the one's that you are interested in.

Kind regards,

Bruno

Read only

Former Member
0 Likes
356

thank u