2011 Feb 08 9:09 AM
Hi experts,
I have to modify fields function1 and fucntion2 in exit EXIT_SAPLCY19_001. This is my code, which doesn't work:
LOOP AT cyexit_1.
cyexit_1-function2 = '3'.
cyexit_1-function1 = '2'.
MODIFY cyexit_1.
ENDLOOP.
As the consultant told me, if we only modify field function1 or fucntion2 it works fine, but whenever we try to modify both at the same time, it doesn't work.
Maybe it's impossible to modify both fields ???
Thanks in advance !!
Marí
2011 Feb 08 12:36 PM
I trust you've already looked at this in Debug? The way we write in ABAP is:
Loop at <tablename> assigning <field symbol>. (field symbol is typed same as internal table
<fieldsymbol>-fieldname1 = value.
<fieldsymbol>-fieldname2 = value.
.....etc.
endloop.
No need to modify with field symbols (pointers). If you want to do old way, do like this:
LOOP AT cyexit_1. "assumes obsolete usage - has header row?
lv_index = sy-tabix. " lv_index typed sytabix.
cyexit_1-function2 = '3'.
cyexit_1-function1 = '2'.
MODIFY cyexit_1 index lv_index.
ENDLOOP.
2011 Feb 08 12:54 PM
Hi again, I prefer to do it the "old way" (i'm don't usually use field-symbols).
Anyway, the consultant told me that if I change the field EPANF, it works. I mean:
LOOP AT cyexit_1.
cyexit_1-EPANF = '20110201'.
cyexit_1-function1 = '3'.
cyexit_1-function2 = '2'.
MODIFY cyexit_1.
ENDLOOP.
So she thinks maybe the problem is that we need to fill the new date for the order..
2011 Feb 08 1:34 PM
Hello,
there's an example how to use this exit in the include LXCY0F01 (Function-Group XCY0).
Regards
Wolfgang
2011 Feb 08 2:07 PM
Thanks Wolfgang!! I saw it yesterday but as you can see, field function2 is not being used... I think my problem is that I have to fill field EPANF in order to reaorganise modified orders...
CYEXIT_1-VGW05 = TIME5.
CYEXIT_1-VGE06 = UNIT.
CYEXIT_1-VGW06 = TIME6.
CYEXIT_1-DAUNE =
CYEXIT_1-DAUNO =
CYEXIT_1-ARBEH =
CYEXIT_1-ARBEI =
CYEXIT_1-ARBID
CYEXIT_1-SEQNR = 11111.
CYEXIT_1-SEQNRV = 22222.
CYEXIT_1-FUNCTION1 = '1'.
CYEXIT_1-FUNCTION2 = '2'.
2011 Feb 08 2:38 PM
Hello,
if you set the function '2', you'll have to fill EPANF , if you use forward scheduling. you'll have to set EPEND, if you use
backward scheduling.
That's independent from the field you use to set this function, function1 or function2 .
Regards
Wolfgang
Edited by: Wolfgang Valtin on Feb 8, 2011 3:40 PM