2009 Jan 17 10:16 AM
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
2009 Jan 17 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.
2009 Jan 17 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.
2009 Jan 17 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.
2009 Jan 17 10:27 AM
Hi TT ,
but it's give me syntax error.
"ZANN" is not an internal table "OCCURS n" specification is missing.
Regards.
Sam.
2009 Jan 17 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
2009 Jan 17 10:29 AM
2009 Jan 17 10:40 AM
ya...change the insert statement to
INSERT INTO ZANN VALUES WA.