2006 Feb 16 2:21 PM
Hi,
im doing bdc,one field meins is getting converted into internal format,so im using conversion exit for that.when i run the program im getting a dump saying output parameter not defined.but i had defined.can u please help me with some code.i tried by reading that FM in different part of program but not working.PLz help me out.
2006 Feb 16 2:25 PM
Hi,
1. Did you try to start the bdc in screen mode ?
2. Did you try to use the T006A to use the value of MEINS for your language ?
Rgd
Frédéric
2006 Feb 16 2:27 PM
2006 Feb 16 2:29 PM
tables:asmd,asmdt,t006.
data:index like sy-index,
tabix like sy-tabix.
data:jtab like bdcdata occurs 0 with header line.
DATA MESSAGES LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
DATA IASMD LIKE t006 OCCURS 0 with header line.
data: pmeins(4) type c,
sylang like sy-langu.
data:Asn like asmd-asnum,
i like asmd-asnum.
selection-screen begin of block service.
select-options: num for asmd-asnum.
Parameters: Astyp like asmd-astyp,
unit like t006-Msehi.
parameters:asktx like asmdt-asktx.
parameters chgtxt like asmd-chgtext as checkbox.
selection-screen end of block service.
data unit1 like unit.
start-of-selection.
unit1 = unit.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = unit1
LANGUAGE = SY-LANGU
IMPORTING
LONG_TEXT =
OUTPUT = pmeins
SHORT_TEXT =
EXCEPTIONS
UNIT_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.
if not num-high = ' '.
i = num-high - num-low.
i = i + 1.
asn = num-low.
do i times.
if asn > num-high.
exit.
endif.
perform upload using asn astyp unit1 asktx chgtxt.
asn = asn + 1.
enddo.
Write:/ i, 'Records was Created'.
else.
asn = num-low.
perform upload using asn astyp unit asktx chgtxt.
if sy-subrc <> 0.
loop at messages.
write:/ messages-msgtyp,messages-fldname.
endloop.
else.
Write:/ 'Records was Created'.
endif.
endif.
&----
*& Form upload
&----
text
----
-->P_ASN text
-->P_ASTYP text
-->P_MEINS text
-->P_ASKTX text
-->P_CHGTXT text
----
FORM upload USING P_ASN
P_ASTYP
P_MEINS
P_ASKTX
P_CHGTXT.
DATA ETAB LIKE ITAB OCCURS 0 WITH HEADER LINE.
REFRESH JTAB.
perform bdc_dynpro using 'SAPLBAS0' '0300'.
perform bdc_field using 'BDC_CURSOR'
'ASMD-ASNUM'.
perform bdc_field using 'BDC_OKCODE'
'=NEW'.
perform bdc_field using 'RM63T-SPRAS'
'DE'.
perform bdc_dynpro using 'SAPLBAS0' '0300'.
perform bdc_field using 'BDC_CURSOR'
'ASMD-ASTYP'.
perform bdc_field using 'BDC_OKCODE'
'POST'.
perform bdc_field using 'ASMD-ASNUM'
P_ASN.
perform bdc_field using 'ASMDT-ASKTX'
P_ASKTX.
perform bdc_field using 'ASMD-ASTYP'
P_ASTYP.
perform bdc_field using 'ASMD-CHGTEXT'
P_CHGTXT.
perform bdc_field using 'ASMD-MEINS'
p_meins.
perform bdc_field using 'RM63T-SPRAS'
'DE'.
CALL TRANSACTION 'AC02' USING JTAB MODE 'N' update 'S' MESSAGES INTO
MESSAGES.
ENDFORM. " upload
************************************************************************
Ende Hauptprogramm / end of main program
************************************************************************
----
Start new screen *
----
FORM BDC_DYNPRO USING PROGRAM DYNPRO.
CLEAR JTAB.
JTAB-PROGRAM = PROGRAM.
JTAB-DYNPRO = DYNPRO.
JTAB-DYNBEGIN = 'X'.
APPEND JTAB.
ENDFORM. "BDC_DYNPRO
----
Insert field *
----
FORM BDC_FIELD USING FNAM FVAL.
IF FVAL <> SPACE.
CLEAR JTAB.
JTAB-FNAM = FNAM.
JTAB-FVAL = FVAL.
APPEND JTAB.
ENDIF.
ENDFORM. "BDC_FIELD
2006 Feb 16 2:46 PM
Hi Banita,
Please use function :
CONVERSION_EXIT_CUNIT_INPUT
Lanka
2006 Feb 16 2:47 PM
Could you try to replace the FM CONVERSION_EXIT_CUNIT_OUTPUT,
with a simple select of the T006A, and use the field MSEH3 instead of your MSEHI.
Rgd
Frédéric
2006 Feb 16 2:53 PM
You your code you have the output parameter commented out.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = unit1
LANGUAGE = SY-LANGU
* IMPORTING
* LONG_TEXT =
<b>* OUTPUT = pmeins</b>
* SHORT_TEXT =
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
You will need to uncomment that line in order to have the output passed back to you.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = unit1
LANGUAGE = SY-LANGU
<b> IMPORTING</b>
* LONG_TEXT =
<b> OUTPUT = pmeins</b>
* SHORT_TEXT =
* EXCEPTIONS
* UNIT_NOT_FOUND = 1
* OTHERS = 2
Regards,
Rich Heilman
2006 Feb 16 3:13 PM
Rich Heilman,
hi if i m uncommenting the output it is putting me dump.by showing output not deined.what to do now.
2006 Feb 16 3:18 PM
2006 Feb 16 3:29 PM
hi,
i think im not bothering you much,im getting the duimp as soon as the Fm is called the output parameter is not commented.
2006 Feb 16 3:31 PM