2006 Aug 20 10:20 AM
I have created a ZZ field and appended to the Extract Structure for the Material Master BW DataSource.
However, I need to write the logic to populate the component. What I am trying to do is as follows:
1) In my ZZ field I am grouping MARA-MAKTL into 3 categories; IMPLANT, INSTRUMENT and NOT KNOWN.
2) All MARA-MAKTL starting with 1 (maximum of 3 characters) and MARA-MAKTL 991 are IMPLANTS
3) All MARA-MAKTL starting with 2 (maximum of 3 characters) and MARA-MAKTL 992 are INSTRUMENTS
4) All other MARA-MAKTL are NOT KNOWN
The problem I am having is I do not know how to group. Can someone assist with writing this code? Thanks
I have now written some logic as follows:
DATA: gw_mara TYPE biw_mara_s
CLEAR gw_mara.
IF sy-subrc IS INITIAL.
IF
gw_mara-maktl+0(1) = "1" OR gw_mara-maktl = "991"
THEN
gw_mara-ZZBWIMPINST = "IMPLANT".
ELSEIF
gw_mara-maktl+0(1) = "2" OR gw_mara-maktl = "992"
THEN
gw_mara-ZZBWIMPINST = "INSTRUMENT"
ELSE
gw_mara-ZZBWIMPINST = "NOT KNOWN"
ENDIF.
ENDIF.
But get the message:
"Incorrect logical expression...
Why is this? Thanks
Message was edited by: Niten Shah
2006 Aug 20 8:53 PM
Hello Niten
There are some mistakes in the coding.
(1) Literal values are placed inbetween ' ' and not " ".
(2) <i>then</i> (like in Java) does not exist in ABAP
(3) Does the first IF statement have any meaning? I did not see it that's why I inactivated the coding.
DATA: gw_mara TYPE z_biw_mara_s.
CLEAR gw_mara.
*IF sy-subrc IS INITIAL.
IF ( gw_mara-matkl+0(1) = '1' OR
gw_mara-matkl = '991' ).
*then " does not exist in ABAP
gw_mara-zzbwimpinst = 'IMPLANT'.
ELSEIF ( gw_mara-matkl+0(1) = '2' OR
gw_mara-matkl = '992' ).
*then " does not exist in ABAP
gw_mara-zzbwimpinst = 'INSTRUMENT'.
ELSE.
gw_mara-zzbwimpinst = 'NOT KNOWN'.
ENDIF.
*ENDIF.Regards
Uwe
I have created a ZZ field and appended to the Extract Structure for the Material Master BW DataSource.
However, I need to write the logic to populate the component. What I am trying to do is as follows:
1) In my ZZ field I am grouping MARA-MAKTL into 3 categories; IMPLANT, INSTRUMENT and NOT KNOWN.
2) All MARA-MAKTL starting with 1 (maximum of 3 characters) and MARA-MAKTL 991 are IMPLANTS
3) All MARA-MAKTL starting with 2 (maximum of 3 characters) and MARA-MAKTL 992 are INSTRUMENTS
4) All other MARA-MAKTL are NOT KNOWN
The problem I am having is I do not know how to group. Can someone assist with writing this code? Thanks
I have now written some logic as follows:
DATA: gw_mara TYPE biw_mara_s
CLEAR gw_mara.
IF sy-subrc IS INITIAL.
IF
gw_mara-maktl+0(1) = "1" OR gw_mara-maktl = "991"
THEN
gw_mara-ZZBWIMPINST = "IMPLANT".
ELSEIF
gw_mara-maktl+0(1) = "2" OR gw_mara-maktl = "992"
THEN
gw_mara-ZZBWIMPINST = "INSTRUMENT"
ELSE
gw_mara-ZZBWIMPINST = "NOT KNOWN"
ENDIF.
ENDIF.
But get the message:
"Incorrect logical expression...
Why is this? Thanks
Message was edited by: Niten Shah
2006 Aug 20 8:53 PM
Hello Niten
There are some mistakes in the coding.
(1) Literal values are placed inbetween ' ' and not " ".
(2) <i>then</i> (like in Java) does not exist in ABAP
(3) Does the first IF statement have any meaning? I did not see it that's why I inactivated the coding.
DATA: gw_mara TYPE z_biw_mara_s.
CLEAR gw_mara.
*IF sy-subrc IS INITIAL.
IF ( gw_mara-matkl+0(1) = '1' OR
gw_mara-matkl = '991' ).
*then " does not exist in ABAP
gw_mara-zzbwimpinst = 'IMPLANT'.
ELSEIF ( gw_mara-matkl+0(1) = '2' OR
gw_mara-matkl = '992' ).
*then " does not exist in ABAP
gw_mara-zzbwimpinst = 'INSTRUMENT'.
ELSE.
gw_mara-zzbwimpinst = 'NOT KNOWN'.
ENDIF.
*ENDIF.Regards
Uwe
2006 Aug 21 9:46 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |