Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

conversion exit

Former Member
0 Likes
1,263

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.

10 REPLIES 10
Read only

FredericGirod
Active Contributor
0 Likes
1,226

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

Read only

0 Likes
1,226

Post the code please.

Regards,

Rich Heilman

Read only

0 Likes
1,226

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

Read only

0 Likes
1,226

Hi Banita,

Please use function :

CONVERSION_EXIT_CUNIT_INPUT

Lanka

Read only

0 Likes
1,226

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

Read only

0 Likes
1,226

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

Read only

0 Likes
1,226

Rich Heilman,

hi if i m uncommenting the output it is putting me dump.by showing output not deined.what to do now.

Read only

0 Likes
1,226

Put a break point in your program and step thru it, where exactly is it dumping, after the conersion routine call, or during the BDC.

I'm not running the BDC in my system, but the rest of it seems to be working good on my side.

Regards,

Rich Heilman

Read only

0 Likes
1,226

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.

Read only

0 Likes
1,226

No bother. Uncomment the IMPORTING line as well.

Regards,

Rich Heilman