Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

I am getting problem with internal table & work area declaration.

Former Member
0 Likes
1,315

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.

11 REPLIES 11
Read only

former_member201275
Active Contributor
0 Likes
1,267

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.

Read only

ronaldo_aparecido
Contributor
0 Likes
1,267

HI


lvc_t_styl is a table and not a field.

Read only

ronaldo_aparecido
Contributor
0 Likes
1,267

What is this celltab .What siza ,type ?

Read only

0 Likes
1,267

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

Read only

Former Member
0 Likes
1,267

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

Read only

0 Likes
1,267

i added my code above ..please reffer and give answer

Read only

Former Member
0 Likes
1,267

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

Read only

0 Likes
1,267

i added my code above ..please reffer and give answer

Read only

0 Likes
1,267

Please givereply any one

Read only

Former Member
0 Likes
1,267

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

Read only

0 Likes
1,267

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.