04-21-2020 8:41 AM
Hello
My name is Marko and i have a problem with IF function in transaction cewb/sap_item/items overview/mass change. I want to create a IF statement in ABAP editor when certan material is listed the field Quantity (ITM_CLASS_DATA-MENGE) changes.
Materail 11111
* X is the value you must return
form GET_NEW_ITM_CLASS_DATA_MENGE
using segment structure ITM_CLASS_DATA
changing X.
IF MBM_CLASS_VIEW-MATNR ='11111'.
write '2222'.
ELSE.
write ''.
ENDIF.
04-21-2020 11:01 AM
You dont give any detailed information about your problem, but looking at your coding, I have to assume, that your problem is based on missing leading zeros for your material number.
See the following coding to fix your 'problem'.
DATA matnr TYPE matnr. " is either 18 or 40 characters, depending on your system and activation status (ECC or S/4HANA)
matnrchk = '11111'.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
INPUT = matnrchk
IMPORTING
OUTPUT = matnrchk
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
" handle exception
ENDIF.
IF MBM_CLASS_VIEW-MATNR = matnrchk.
WRITE '2222'.
ELSE.
WRITE ''.
ENDIF.
(If this is not your problem at all, please be more specific, give screenshots, syntax/runtime errors, observed vs. expected behaviour, ...)
04-24-2020 6:15 PM
04-24-2020 6:16 PM
04-24-2020 6:22 PM
05-13-2020 4:21 PM
Marko Skvarča, so what have you found out after changing the coding to fill the MATNR with leading zeros?
>> Thank you for appropriate answer but i will need so more explanation. I copy your code to sap/cewb/sap item/extras/mass edit/enter formulas/abap editor/ and change the number id and the resolt of if statment.
Is your IF statement now executed? If so, I assume you have encountered the next problem, which is that you dont know 'where to write' the new value?
If you want someone to be notified, you have to either comment their question, or mention them directly in your post, like this Marko Skvarča.
If your problem has been solved by now, please follow up on your open question.
04-23-2020 12:01 PM
I want a code to create an if statement if MBM_CLASS_VIEW-MATNR = 50080 write 84 in field ITM_CLASS_DATA-MENGE.
04-23-2020 12:26 PM
04-24-2020 10:55 PM
If you know where to place the coding, my initial answer will work. I assume you dont know where to place your coding? In that case, your question shouldnt be about an arbitrary IF-statement, it should be about how to manipulate CEWB with Badis, Enhancements Spots, User Exits or Modifications.
04-28-2020 7:21 PM
Thank you for appropriate answer but i will need so more explanation. I copy your code to sap/cewb/sap item/extras/mass edit/enter formulas/abap editor/ and change the number id and the resolt of if statment.