2007 Jul 01 6:02 AM
Hi Everyone,
I having an upload file which contains following fields in internal table. I wanna to check the Functional Location in upload file whether is exist in system database. If that record does not exist......i want to display the name of functional location which does not found.
Below are the code....but i still not manage to check the existance of it. Please help to correct the code as i require it urgently. Appreciate ur help. Thanks.
<u><b>Internal Table:</b></u>
DATA : BEGIN OF i_input OCCURS 0,
tplnr LIKE iflo-tplnr, "Functional Location
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
data: lwa_input like i_input,
lv_tplnr like iflot-tplnr.
loop at i_input into lwa_input.
select single
tplnr
into lv_tplnr
from iflot
where tplnr = lwa_input-tplnr.
if sy-subrc <> 0 and lv_tplnr is initial.
write 😕 'Functional Location', lwa_input-tplnr, 'Does Not exist'.
else.
write:/ 'records found'.
endif.
clear: lwa_input, lv_tplnr.
endloop.
2007 Jul 02 5:18 AM
Hi Sweet,
Your code is absolutely correct. But i think you are getting all values as does not exist. Just try this conversion exit Function Module 'CONVERSION_EXIT_TPLNR_INPUT'. it should work fine.
&----
*& Report ZGS_TEST1
*&
&----
*&
*&
&----
REPORT ZGS_TEST1.
DATA : BEGIN OF i_input OCCURS 0,
tplnr LIKE iflo-tplnr, "Functional Location
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
data: lwa_input like i_input,
lv_tplnr like iflot-tplnr.
loop at i_input into lwa_input.
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_INPUT'
EXPORTING
input = lwa_input-tplnr
I_FLG_CHECK_INTERNAL = 'X'
IMPORTING
OUTPUT = lwa_input-tplnr
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
select single
tplnr
into lv_tplnr
from iflot
where tplnr = lwa_input-tplnr.
if sy-subrc <> 0 and lv_tplnr is initial.
write 😕 'Functional Location', lwa_input-tplnr, 'Does Not exist'.
else.
write:/ 'records found'.
endif.
clear: lwa_input, lv_tplnr.
endloop.
Please reward sweet points,
Aleem.
Hi Everyone,
I having an upload file which contains following fields in internal table. I wanna to check the Functional Location in upload file whether is exist in system database. If that record does not exist......i want to display the name of functional location which does not found.
Below are the code....but i still not manage to check the existance of it. Please help to correct the code as i require it urgently. Appreciate ur help. Thanks.
<u><b>Internal Table:</b></u>
DATA : BEGIN OF i_input OCCURS 0,
tplnr LIKE iflo-tplnr, "Functional Location
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
data: lwa_input like i_input,
lv_tplnr like iflot-tplnr.
loop at i_input into lwa_input.
select single
tplnr
into lv_tplnr
from iflot
where tplnr = lwa_input-tplnr.
if sy-subrc <> 0 and lv_tplnr is initial.
write 😕 'Functional Location', lwa_input-tplnr, 'Does Not exist'.
else.
write:/ 'records found'.
endif.
clear: lwa_input, lv_tplnr.
endloop.
2007 Jul 01 7:36 AM
hi,
you can change internal table tabale field and try.............
DATA : BEGIN OF i_input OCCURS 0,
<b> tplnr LIKE iflo-tplnr, "Functional Location</b>
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
you decalre that field of type <b>iflot-tplnr</b> not like t iflo-tplnr.
DATA : BEGIN OF i_input OCCURS 0,
<b> tplnr LIKE iflot-tplnr, "Functional Location</b>
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
if possible create structure with TYPES statement insted of creating with DATA.
regards,
Ashok Reddy
2007 Jul 01 9:18 AM
Hi Ashok,
It seem like all floc from input file (internal table)are displayed as 'does not exist'.
Is it the correct way to check the data exist against database?
I only want check against my input file to determine the floc whether exist in db.
if does not exist......display that records as error.
2007 Jul 02 5:18 AM
Hi Sweet,
Your code is absolutely correct. But i think you are getting all values as does not exist. Just try this conversion exit Function Module 'CONVERSION_EXIT_TPLNR_INPUT'. it should work fine.
&----
*& Report ZGS_TEST1
*&
&----
*&
*&
&----
REPORT ZGS_TEST1.
DATA : BEGIN OF i_input OCCURS 0,
tplnr LIKE iflo-tplnr, "Functional Location
dokar LIKE draw-dokar, "Document Type
doknr LIKE draw-doknr, "Document
doktl LIKE draw-doktl, "Document Part
dokvr LIKE draw-dokvr, "Document Version
END OF i_input.
data: lwa_input like i_input,
lv_tplnr like iflot-tplnr.
loop at i_input into lwa_input.
CALL FUNCTION 'CONVERSION_EXIT_TPLNR_INPUT'
EXPORTING
input = lwa_input-tplnr
I_FLG_CHECK_INTERNAL = 'X'
IMPORTING
OUTPUT = lwa_input-tplnr
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
select single
tplnr
into lv_tplnr
from iflot
where tplnr = lwa_input-tplnr.
if sy-subrc <> 0 and lv_tplnr is initial.
write 😕 'Functional Location', lwa_input-tplnr, 'Does Not exist'.
else.
write:/ 'records found'.
endif.
clear: lwa_input, lv_tplnr.
endloop.
Please reward sweet points,
Aleem.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |