Skip to Content
author's profile photo Former Member
Former Member

how can i deal with screen in module pool to insert data to customer table

i'm trying to insert data to customer table through my screen but getting the error work area is not long enough. how to resolve it. i checked previous

discussions but it is not helpful for me.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 25, 2013 at 10:03 AM

    Hi,

    Check your select statement and internal table declarations!

    You can use the move corresponding in select statement. If not add your code here!

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Shrivas,

      In table control PAI ,

      On save you should write the code to insert / modify the databsae table from your work area ,

      eg . MODIFY ekpo FROM wa.

      also you need to add the values from wa to your internal table IT in PAI so that when the flow goes back to PBO it will loop the IT into wa and will be displayed in table control.

      The problem you are facing is because your internal table is not filled with the values entered in table control and in PBO blank table is looped . so your table control is getting blank.

  • Posted on Dec 25, 2013 at 10:03 AM

    Hi Shri vas,

    Do the data types of your screen fields match with those of your custom table fields ?

    Br,

    Shankar.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 25, 2013 at 10:27 AM

    Hi Shrivas,

    no it not only the way you can use insert or modify command also from your ABAP code, But it is not the correct way to update the standard table .

    the insert command is like that.

    INSERT INTO dbtab VALUES wa.

    or from int table

    INSERT dbtab FROM TABLE itab.

    for modify

    MODIFY dbtab FROM wa.

    or from int table

    MODIFY dbtab FROM TABLE itab.

    you can use either BDC or BAPI to update Customer Details.

    Regrads,

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Shrivas,

      KNA1 Tables is not a single table which contains customer details. It has other table its dependency. that is the reason . you are getting error.

      it is not advisable to change or insert data directly in Std. Tables.

      Please make practice to change it using BDC or BAPI.

      BAPI (BAPI_CUSTOMER_CREATE ) for creation of Customer.

  • Posted on Dec 25, 2013 at 11:52 AM

    Hi Shrivas,

    The error you are getting of ' wa not too long ' is because your work area contains only 3 fields ,

    whereas the table ( kna1 ) in which you are trying to insert the data consists of many more fields.

    Solution for your error is that when you define your work area define like below.

    DATA : BEGIN OF WA.

    INCLUDE STRUCTURE KNA1.

    DATA : END OF WA.


    DATA : ITAB LIKE TABLE OF WA.


    And when you create your screen add your fields from program using your WA.


    in customer no. field property add conv. exit as ALPHA .


    Code on save.


    case sy-ucomm.

    when 'SAVE'.

    wa-mandt = sy-mandt.

    insert kna1 from wa.

    when others.

    endcase.


    Note : Use this program only for testing purpose as it is not advisable to manually add fields to KNA1.



    Reward points if useful 😊

    Message was edited by: Suhas Saha

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.