‎2004 Nov 25 1:36 PM
Can anyone help me in wriitng the code for the following
First
Second
third
VERSI can have values 100 and Above ?
‎2004 Nov 25 2:09 PM
Hi Oliver,
The following code should give you some clues:
DATA: itab TYPE tkvst OCCURS 0,
wtab TYPE tkvst.
SELECT *
INTO itab
FROM tkvst
WHERE spras CO 'DE'.
IF sy-subrc EQ 0.
LOOP AT itab INTO wtab
WHERE spras EQ 'D'.
CASE wtab-versi.
WHEN '000'.
IF wtab-vtext NE 'plan/Ist-version'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '001'.
IF wtab-vtext NE 'Plan version änderung 1'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '002'.
IF wtab-vtext NE 'plan version änderung 2'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '003'.
IF wtab-vtext NE 'plan verison änderung 3'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '004' OR '005' OR '006' OR '007' OR '008' OR '009'.
WRITE: / 'Error: ', wtab.
WHEN OTHERS.
No Error
ENDCASE.
ENDLOOP.
LOOP AT itab INTO wtab
WHERE spras EQ 'D'.
CASE wtab-versi.
WHEN '000'.
IF wtab-vtext NE 'plan/Ist-version'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '001'.
IF wtab-vtext NE 'Plan version revision 1'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '002'.
IF wtab-vtext NE 'Plan version revision 2'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '003'.
IF wtab-vtext NE 'Plan version revision 3'.
WRITE: / 'Error: ', wtab.
ELSE.
No error
ENDIF.
WHEN '004' OR '005' OR '006' OR '007' OR '008' OR '009'.
WRITE: / 'Error: ', wtab.
WHEN OTHERS.
No Error
ENDCASE.
ENDLOOP.
ENDIF.
Regards,
Rob.
‎2004 Nov 25 3:12 PM
Hello Oliver,
The following SELECT statement should help you.
tables tkvst.
select *
from tkvst
where spras in ('DE','EN') and versi not in ('000','001','002','003')
or ( versi between '004' and '099' ).
write: / tkvst-spras, tkvst-versi, tkvst-vtext.
endselect.
Please note that I have not considered the field VTEXT here. I do not know the reason why you are writing this report, but these tind of tables contain control information (unlike other tables which contain the Master / Transaction data) are populated through the customizing transaction, SPRO. So usually somebody who wants to know the CO Versions and their texts would go to SPRO and then see the entries in the table directly.
Anyways, if you are very particular that the VTEXT field also contains exactly the values you have provided (case-sensivite), then you can extend the above select statement to achieve the same. Or, you might want to code another new select, which might provide you better code-readability.
Hope this information will be helpful.
Regards,
Anand Mandalika.