on 05-06-2009 3:30 PM
Hello Friends,
I have code as below where name1 and LIFNR are the paramenters in WD I am sending it out to FM. But, when I compile I get the error as "The field "LIFNR" cannot be changed" LIFNR is CHAR size 10. I think normally a CHAR data type should hold the numbers. Incase not, then can any one show me how to do type casting or what is the correct way to code so that it holds the value that could be passed to LIFNR.
lv_zvendorlist = name1.
DATA vendnamenum type string.
DATA: vendname type string, vendnum type string.
vendnamenum = lv_zvendorlist.
SPLIT vendnamenum at '-' INTO vendname vendnum.
IF vendnum is NOT INITIAL.
write: vendnum+0(1).
ENDIF.
lv_zlifnr = vendnum.
LIFNR = lv_zlifnr.
Thks & Rgds,
Hemal
Answerd self.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have fixed the code by passing the value directly to the field of a context node. the fix is as below for future reference.
lv_zvendorlist = name1.
get single attribute
lo_el_inv_input_values->get_attribute(
EXPORTING
name = `ZVENDORLIST`
IMPORTING
value = lv_zvendorlist ).
DATA vendnamenum type string.
DATA: vendname type string, vendnum type string.
vendnamenum = lv_zvendorlist.
SPLIT vendnamenum at '-' INTO vendname vendnum.
lv_zlifnr = vendnum.
set single attribute
lo_el_inv_input_values->set_attribute(
EXPORTING
name = `ZLIFNR`
value = lv_zlifnr ).
Thks & Rgds,
Hemal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.