‎2006 Aug 03 8:59 AM
Hi, The following codes did not make the SELECT work. Both l_vbeln and l_psonr has good value to call the vbrp table. The sy-subrc = 4. Any idea? I appreciate your help.
Thanks,
Helen
DATA:l_vbeln TYPE vbrp-vbeln,
l_posnr TYPE vbrp-posnr,
l_aubel TYPE vbrp-aubel,
l_aupos TYPE vbrp-aupos.
l_vbeln = lw_auditin-invno.
l_posnr = lw_auditin-invitemno.
SELECT SINGLE aubel aupos "Sales Doc; Sales Item
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln AND
posnr = l_posnr.
‎2006 Aug 03 9:02 AM
Hello Helen,
Before the select stmt use the anyone of the FM
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
to do the conversion exit.
Then the select stmt will work for u.
Reward if helps.
Vasanth
‎2006 Aug 03 9:02 AM
‎2006 Aug 03 9:26 AM
‎2006 Aug 03 9:32 AM
Helen,
Another thing would be to define the variables lw_audit* similar to vbeln and posnr from vbrp.
I feel that would help and you wouldnt require the fm conversion exit. Also, it would be nice to understand the logic where you populate the particular fields.
Regards
Anurag
‎2006 Aug 03 9:02 AM
Hello Helen,
Before the select stmt use the anyone of the FM
CONVERSION_EXIT_ALPHA_INPUT Conversion exit ALPHA, external->internal
CONVERSION_EXIT_ALPHA_OUTPUT Conversion exit ALPHA, internal->external
to do the conversion exit.
Then the select stmt will work for u.
Reward if helps.
Vasanth
‎2006 Aug 03 9:24 AM
I am very new to the ABAP. I add the FM and got the syntax error 'OUTPUT" is not expected'. Please advise!
Thanks,
Helen
l_vbeln = lw_auditin-invno.
l_posnr = lw_auditin-invitemno.
<b> CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
IMPORTING
input = l_vbeln
EXPORTING
output = lw_auditin-invno.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
IMPORTING
input = lw_auditin-invitemno
EXPORTING
OUTPUT = l_posnr.</b>
SELECT SINGLE aubel aupos "Sales Doc; Sales Item
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln AND
posnr = l_posnr.
‎2006 Aug 03 9:27 AM
data : l_vbeln typd vbrk-vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
IMPORTING
input = l_vbeln
EXPORTING
output = <b>l_vbeln</b>.
populate same variable name to both import and export parametes as given above.
‎2006 Aug 03 9:29 AM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
IMPORTING
input = lw_auditin-invno
EXPORTING
output = l_vbeln.
SELECT SINGLE aubel aupos "Sales Doc; Sales Item
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln AND
posnr = l_posnr.
Conversion for posnr is not required as it of type numc.
‎2006 Aug 03 9:33 AM
here i am placing the way how to have to do.
data : l_vbeln type vbrp-vbeln.
l_vbeln = lw_auditin-invno.
*--now call the conversion exit to convert external value to SAP internal format
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
IMPORTING
input = l_vbeln
EXPORTING
output = l_vbeln.
both the places, you can pass the same field
<b>l_vbeln</b>
SELECT SINGLE aubel aupos
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln AND
posnr = l_posnr.
i believe, POSNR is a numeric field. so no need to use conversion routine for that field.but check this whether POSNR is a char or NUMC field in VBRP.
regards
srikanth.
‎2006 Aug 03 9:49 AM
I pass the syntax error,but get the run time error at the function Module
Helen
‎2006 Aug 03 10:03 AM
Can you please include the piece of code where you have defined lw_auditin* variables and secondly, where you initialise the same.
Regards
Anurag
‎2006 Aug 03 10:04 AM
Here is the run time error message:
Incorrect parameter with CALL FUNCTION.
When calling a function module, one of the parmaeters was notspecified. Error in ABAP application program.
An exception occurred. This exception is dealt with in more detail below. The exception, which is assigned to the class 'CX_SY_DYN_CALL_PARAM_MISSING'.
005680 l_vbeln = lw_auditin-invno.
005690 l_posnr = lw_auditin-invitemno.
005700
-
> CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
005720 EXPORTING
005730 output = l_vbeln
005740 IMPORTING
005750 input = l_vbeln.
005760
005770 SELECT SINGLE aubel aupos "Sales Doc; Sales Item
005780 INTO (l_aubel, l_aupos)
005790 FROM vbrp "Billing Doc
005800 WHERE vbeln = l_vbeln AND
005810 posnr = l_posnr.
‎2006 Aug 03 10:11 AM
Note: The input to the invno and invitemno are CHARACTERS.
TYPES : BEGIN OF type_auditin_mapping ,
companyid TYPE char2,
invno TYPE vbrp-vbeln,
invitemno TYPE vbrp-posnr,
invdate TYPE vbrp-fbuda,
taxprodcode TYPE char9,
prodcode TYPE char25,
grossamt TYPE char13,
fedtxamt TYPE char13,
sttxamt TYPE char13,
countytxamt TYPE char13,
citytxamt TYPE char13,
END OF type_auditin_mapping.
DATA : lw_auditin TYPE type_auditin_mapping.
DATA:l_vbeln TYPE vbrp-vbeln,
l_posnr TYPE vbrp-posnr.
l_vbeln = lw_auditin-invno.
l_posnr = lw_auditin-invitemno.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
output = l_vbeln
IMPORTING
input = l_vbeln.
SELECT SINGLE aubel aupos "Sales Doc; Sales Item
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln AND
posnr = l_posnr.
IF sy-subrc <> 0.
WRITE: / g_inv, '/', g_invitem,
' not found in the vbrp table'.
Thanks,
Helen
‎2006 Aug 03 10:17 AM
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
<b> INPUT = IT_LINE-VBELN this should be first called
IMPORTING
OUTPUT = IT_DELV_DATA-VBELN.then this field.
</b>
it seems to be you have reversed the way of parameters
use first exporting then use importing.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
<b>output = l_vbeln <-- is wrong, here INPUT Should APPEAR</b>
IMPORTING
<b>input = l_vbeln. <--- is also wrong, here OUTPUT should appear .</b>
check this once.
Message was edited by: Srikanth Kidambi
‎2006 Aug 03 10:23 AM
The both invno and initemno are CHARACTERS. I think they should mapping to the vbrp attribute when I split into the lw_auditin-invno and lw_auditin-invitemno. Am my thinking right? I turn debugging on and see the correct value when select.
SPLIT l_data AT g_delimit INTO lw_auditin-companyid
dummy1
lw_auditin-invno
lw_auditin-invitemno
lw_auditin-invdate.
Thanks,
Helen
‎2006 Aug 03 10:28 AM
Please note the change marked Anurag+
TYPES : BEGIN OF type_auditin_mapping ,
companyid TYPE char2,
invno TYPE vbrp-vbeln,
invitemno TYPE vbrp-posnr,
invdate TYPE vbrp-fbuda,
taxprodcode TYPE char9,
prodcode TYPE char25,
grossamt TYPE char13,
fedtxamt TYPE char13,
sttxamt TYPE char13,
countytxamt TYPE char13,
citytxamt TYPE char13,
END OF type_auditin_mapping.
DATA : lw_auditin TYPE type_auditin_mapping.
DATA:l_vbeln TYPE vbrp-vbeln,
l_posnr TYPE vbrp-posnr.
l_vbeln = lw_auditin-invno.
l_posnr = lw_auditin-invitemno.
Anurag+
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lw_auditin-invno
IMPORTING
output = l_vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lw_auditin-invitemno
imPORTING
output = l_posnr.
Anurag+
SELECT SINGLE aubel aupos "Sales Doc; Sales Item
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln
AND posnr = l_posnr.
IF sy-subrc <> 0.
WRITE: / g_inv, '/', g_invitem,
' not found in the vbrp table'.
-
If the above does not work try to define the variables l_vbeln(10) type n, l_posnr(6) type n..in this case we would not need the conversion functions.
Regards
Anurag
‎2006 Aug 03 10:30 AM
Please paste the complete code where you initialise the data in lw_auditin structure.
It would be nice with some sample data if you are doing it through an input file or so.
Regards
Anurag
Message was edited by: Anurag Bankley
‎2006 Aug 03 10:32 AM
I changed the input and output and the ABAP runtime error is gone. However, I still did not get the 'SELECT' work. I saw the '90000008' changed to '0090000008' after the FM called. The next one is l_posnr = 10. How did I see it is character 10 or numeric 10?
Thanks,
Helen
‎2006 Aug 03 10:36 AM
It seems to be char 10...please use the similar conversion for posnr...it value should change to 000010.
Regards
Anurag
‎2006 Aug 03 10:37 AM
How did I see it is character 10 or numeric 10?
if the variable defined as
data : v_numc(5) type n.
then you will see the value as 00010 in debugging NOT just 10.
as you defined POSNR variable as vbrp-posnr, no probs
it will be NUMC of 5 length.
so now check the value of POSNR whether it is preceded with leading zeros or not before that SELECT Statement.
Message was edited by: Srikanth Kidambi
‎2006 Aug 03 11:03 AM
It works with the second conversion !!!
Thanks so much for your help.
Helen
‎2006 Aug 03 9:04 AM
your VBELN having 10 characters or not ?
i mean '123' will be different with '0000000123' if you pass to VBRP table .
so use conversion_exit to convert to SAP internal format then pass that VBELN to the select .
hope this will help you.
regards
srikanth
‎2006 Aug 03 9:27 AM
Hi,
Try this
data : l-vbeln type VBELN.
l_vbeln = lw_auditin-invno.
l_posnr = lw_auditin-invitemno.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
IMPORTING
input = l_vbeln
EXPORTING
output = l_vbeln.
SELECT SINGLE aubel aupos "Sales Doc; Sales Item
INTO (l_aubel, l_aupos)
FROM vbrp "Billing Doc
WHERE vbeln = l_vbeln AND
posnr = l_posnr.
Conversion for posnr is not required as it of type numc.
Rgds,
Prakash
‎2006 Aug 03 9:34 AM
Helen,
Another thing would be to define the variables lw_audit* similar to vbeln and posnr from vbrp.
I feel that would help and you wouldnt require the fm conversion exit(depending on your logic). Also, it would be nice to understand the logic where you populate the particular fields.
Regards
Anurag
‎2006 Aug 03 9:42 AM
hi,
i can suggest 3 things,
1. tables vbrv. on the top on data declaration
2. use sy-dbcnt,
if sy-dbcnt is initial.
message i123(zxxx).
endif.
3. there is no write statement in the code,to display output,use it,
regards,
kcc