2014 Mar 27 1:38 PM
I am working with 'makt' table ..with the table makt i need to work with styles attributes ..so i declared like this
TYPES : BEGIN OF ty_makt,
matnr TYPE makt-matnr,
spras TYPE makt-spras,
maktx TYPE makt-maktx,
maktg TYPE makt-maktg,
celltab TYPE lvc_t_styl,
END OF ty_makt.
DATA : i_makt TYPE TABLE OF ty_makt.
DATA : wa_makt TYPE ty_makt .
But end of program i need to update dbtable "makt"...i am getting problem with internal table & work area declaration.
i think makt table fields mapping and internal table/work area mapping is not correct. so please help me to get out from this.
2014 Mar 27 1:43 PM
Why are you including a structure used for ALVs in ty_makt when this cannot update to MAKT anyway? (Unless I am missing the point completely). Maybe you can include more detail on the error/s are encountering, and also all your source code.
2014 Mar 27 1:46 PM
2014 Mar 27 1:47 PM
2014 Mar 27 1:48 PM
You have more fields in the internal table than actually in makt. You can use two table one having the same structure as makt and other one with your style attribute. Use first internal table to modify makt table
2014 Mar 27 1:54 PM
Hi Nagasankr,
Ur internal table/Strucure declaration need not be same as database table MAKT.
If you need to update maktg of MAKT for a material then use below code
LOOP AT it_makt INTO wa_makt.
UPDATE makt
SET maktg = wa_makt-maktg
WHERE matnr = wa_matk-matnr AND
spras = wa_makt-spars.
ENDLOOP.
Thanks,
Sachin
2014 Mar 27 2:02 PM
2014 Mar 27 1:55 PM
Hi Nagasankar,
TYPES : BEGIN OF TY_MATNR,
MATNR TYPE MAKT-MATNR,
SPRAS TYPE MAKT-SPRAS,
MAKTX TYPE MAKT-MAKTX,
MAKTX TYPE MAKT-MAKTG,
CELLTAB TYPE LVC_T_STYL, " Its Working perfectly fine..
END OF TY_MAKT.
DATA: IT_MAKT TYPE STANDARD TABLE OF TY_MAKT,
WA_MAKT TYPE TY_MAKT.
Its working perfectly fine. if still you are facing any issue post your complete code.
Thanks,
Sandeep
2014 Mar 27 2:02 PM
2014 Mar 27 2:16 PM
2014 Mar 27 6:14 PM
i am getting problem(Program terminate) when i click on editline while execution ..
APPEND ls_style TO wa_alv-celltab.
how should we modify this work area data to internal table?
Help Meeeee
2014 Mar 27 7:56 PM
Hi Nagasankar Musuluri
You have Basic questions , then you need understand basic concepts abap about workarea ,headerline .
Please study this links :
Appending Table Lines (SAP Library - ABAP Programming (BC-ABA))
http://help.sap.com/abapdocu_70/en/
Then if you have a question please talk us.