2006 Sep 14 10:29 AM
hi friends,
Could please help me how to do this
Read table KNB1 using company code(BUKRS) and G/L Recon Acct(AKONT)
Read table KNA1 using KNB1-KUNNR
If Not found,put out error message,skip processing and read next KNB1 record
for above one i written the coading like this
select kunnr
bukrs
akont
from knb1
into table i_knb1
where bukrs = p_bukrs
AND akont = p_akont.
DESCRIBE TABLE i_knb1 LINES g_line.
LOOP AT i_knb1 INTO wa_knb1.
SELECT single KUNNR
NAME1
STRAS
ORT01
STCD1
PSTLZ
FROM kna1
INTO wa_kna1
where kunnr = wa_knb1-kunnr.
if sy-subrc <> 0.
*<b>Error KNA1 record not found.</b>
count = Count + 1.
endif.
but my problem is they can ask me put one error message
like
If Not found,put out error message,skip
Could u please tell me what type of error message i have to put
i have a little bit confusion
Could u please help me how to do this
Regards
harshavi
hi friends,
Could please help me how to do this
Read table KNB1 using company code(BUKRS) and G/L Recon Acct(AKONT)
Read table KNA1 using KNB1-KUNNR
If Not found,put out error message,skip processing and read next KNB1 record
for above one i written the coading like this
select kunnr
bukrs
akont
from knb1
into table i_knb1
where bukrs = p_bukrs
AND akont = p_akont.
DESCRIBE TABLE i_knb1 LINES g_line.
LOOP AT i_knb1 INTO wa_knb1.
SELECT single KUNNR
NAME1
STRAS
ORT01
STCD1
PSTLZ
FROM kna1
INTO wa_kna1
where kunnr = wa_knb1-kunnr.
if sy-subrc <> 0.
*<b>Error KNA1 record not found.</b>
count = Count + 1.
endif.
but my problem is they can ask me put one error message
like
If Not found,put out error message,skip
Could u please tell me what type of error message i have to put
i have a little bit confusion
Could u please help me how to do this
Regards
harshavi
2006 Sep 14 10:39 AM
hi,
give like this.
if sy-subrc <> 0.
*Error KNA1 record not found.
message 'Data not found' type 'S'.
count = Count + 1.
endif.
*this will give message in status bar.
if we give tyep 'E', there is a chance for dump.
rgds
anver
if hlped rwrd points
2006 Sep 14 10:42 AM
Hi,
if you put error message program will
abend and process next records .
give information message
select kunnr
bukrs
akont
from knb1
into table i_knb1
where bukrs = p_bukrs
AND akont = p_akont.
DESCRIBE TABLE i_knb1 LINES g_line.
LOOP AT i_knb1 INTO wa_knb1.
SELECT single KUNNR
NAME1
STRAS
ORT01
STCD1
PSTLZ
FROM kna1
INTO wa_kna1
where kunnr = wa_knb1-kunnr.
if sy-subrc <> 0.
<b>message i000 "record not found'.
count = Count + 1.
continue.</b>endif.
Regards
amole
2006 Sep 14 10:54 AM
hi,
try this
parameters:p_bukrs like knb1-bukrs,
p_akont like knb1-akont.
start-of-selection.
select kunnr
bukrs
from knb1
into table tb_knb1
where bukrs = p_bukrs amd
akont = p_akont.
if not tb_knb1[] is initial.
select kunnr
name1
stras
from kna1
into table tb_kna1
for all entries in tb_knb1
where kunnr = tb_knb1-kunnr.
if sy-subrc <> 0.
message i000 with 'not found'.
skip.
endif.
regads,
sudha.
2006 Sep 14 10:57 AM
Hi Harshavi,
Give an information message instead of error message, and give text stating with 'ERROR ....'.
regards
Srikanth M
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |