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

modify internal table

Hi,

i want create serial no according to delivery challan no.and save that no in database table.

but record not insert.

my code.

TABLES: zann.

DATA : vbeln TYPE zann-vbeln.

DATA : srno type zann-srno.

DATA: Z_ANN LIKE ZANN OCCURS 0 WITH HEADER LINE.

data: itab type standard table of zann with header line.

PARAMETERS: p_vbeln TYPE zann-vbeln.

START-OF-SELECTION.

SELECT single *

FROM zann into z_ann

WHERE vbeln EQ p_vbeln.

IF sy-subrc = 0.

MESSAGE e001(38) WITH 'Already Exist in the Data Base'.

endif.

CONCATENATE 'D'

p_vbeln

INTO srno.

itab-vbeln = p_vbeln.

itab-srno = srno.

MODIFY TABLE z_ann FROM itab.

thanks in advance.

Regard.

Sam

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 Jan 17, 2009 at 10:22 AM

    do like dis...

    DATA : vbeln TYPE zann-vbeln.

    DATA : srno type zann-srno.

    data: itab type standard table of zann,

    wa type zann.

    PARAMETERS: p_vbeln TYPE zann-vbeln.

    START-OF-SELECTION.

    SELECT single *

    FROM zann into wa

    WHERE vbeln EQ p_vbeln.

    IF sy-subrc = 0.

    MESSAGE e001(38) WITH 'Already Exist in the Data Base'.

    endif.

    CONCATENATE 'D'

    p_vbeln

    INTO srno.

    wa-vbeln = p_vbeln.

    wa-srno = srno.

    INSERT zann FROM wa.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2009 at 10:20 AM

    Hi,

    If u want to insert record , then use insert statement.

    for ex:

    insert zct_plnt_prcntg from g_chgtab_field_wa .

    thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 17, 2009 at 10:29 AM

    problem not solved.

    Edited by: sam on Jan 17, 2009 11:30 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 17, 2009 at 10:24 AM

    Hi,

    Just try like this

    loop at itab.
    CONCATENATE 'D'
                   p_vbeln
              INTO srno.
     
       itab-vbeln = p_vbeln.
       itab-srno  = srno.
    
      MODIFY TABLE z_ann FROM INDEX sy-tabix  itab TRANSPORTING srno.
    endloop.

    Thanks and Regards

    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.