2015 Dec 01 9:51 AM
Hi All,
I am updating client dependent Ztable from a file. Program reads data file and populates them in internal table.
Internal table does not have client field so when using this internal table in MODIFY db FROM TABLE it is giving Unicode error.
Is there any other way than looping on first internal table then populating second internal table with client field in it and, update the db table from second internal table?
2015 Dec 01 10:42 AM
Read again online help/your course: Your structure always had to fulfill the prerequisites for open-sql work area (and that since a long long time) now with Unicode there are even more constaints.
As long as you don't use CLIENT SPECIFIED the system will use current client sy-mandt. Just add MANDT to your internal table, you can keep its value initial.
Regards,
Raymond
Hi All,
I am updating client dependent Ztable from a file. Program reads data file and populates them in internal table.
Internal table does not have client field so when using this internal table in MODIFY db FROM TABLE it is giving Unicode error.
Is there any other way than looping on first internal table then populating second internal table with client field in it and, update the db table from second internal table?
2015 Dec 01 10:05 AM
Hi Jitendra,
Is there any problem to keep client field in internal table?
Thanks and Regards,
Pavan Kumar
2015 Dec 01 10:09 AM
Hi,
File will not have client data and i declared internal table same as file structure to upload data via method cl_gui_frontend_services=>gui_upload.
2015 Dec 01 10:31 AM
Hi,
You can have one client field in both internal table and in uploading file(in file client field data can be blank) or you can use second internal table to update Z table.
Code given to copy internal table data to second internal table with client filed.
TYPES: BEGIN OF ty_itab,
kunnr TYPE kunnr,
ernam TYPE ernam,
END OF ty_itab.
TYPES: BEGIN OF ty_itab1,
mandt TYPE mandt,
kunnr TYPE kunnr,
ernam TYPE ernam,
END OF ty_itab1.
DATA: t_itab1 TYPE TABLE OF ty_itab,
w_itab1 TYPE ty_itab,
t_itab2 TYPE TABLE OF ty_itab1,
w_itab2 TYPE ty_itab1.
LOOP AT t_itab1 INTO w_itab1.
MOVE-CORRESPONDING w_itab1 TO w_itab2.
w_itab2-mandt = sy-mandt.
APPEND w_itab2 TO t_itab2.
ENDLOOP.
MODIFY ztable FROM TABLE t_itab2.
Thanks and Regards,
Pavan Kumar
2015 Dec 01 10:38 AM
I hope you have to maintain the Exact structure In internal table.
2015 Dec 01 10:42 AM
Read again online help/your course: Your structure always had to fulfill the prerequisites for open-sql work area (and that since a long long time) now with Unicode there are even more constaints.
As long as you don't use CLIENT SPECIFIED the system will use current client sy-mandt. Just add MANDT to your internal table, you can keep its value initial.
Regards,
Raymond
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |