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

Data Conversion IssueG

former_member207873
Participant
0 Likes
2,647

Hello Experts,

I wanted to have data  from a field vbrp-vrkme. But when show it in the report it is showing the value as 'TAG'. But where as in the se16n it is showing as

'DAY'. In se 11 also it is showing as TAG. How can I convert 'TAG' into 'DAY'.

Regards,

Marina

1 ACCEPTED SOLUTION
Read only

FredericGirod
Active Contributor
0 Likes
2,565

Hi Marina,

did you check if there is a field conversion exit on your domain VRKME ?

did you try the simple WRITE ...-VRKME TO ...  ?

regards

Fred

14 REPLIES 14
Read only

Former Member
0 Likes
2,565

Hi Marina,

Can you show the code snippet u have written in the report?

Regards,

Shahir Mirza

Read only

0 Likes
2,565

hi,

SELECT  VBRK~FKDAT

         VBRK~SPART

         VBRK~NETWR

         VBRK~KUNAG

         VBRK~KUNRG

         VBRK~SFAKN

         VBRP~VBELN

         VBRP~VKBUR

         VBRP~POSNR

         VBRP~MATNR

         VBRP~ARKTX

         VBRP~FKIMG

         VBRP~VRKME

         INTO CORRESPONDING FIELDS OF TABLE IT_VBRK2

         FROM VBRP JOIN VBRK ON VBRP~VBELN = VBRK~VBELN

         WHERE VBRK~FKDAT IN SO_FKDAT.

   IF IT_VBRK2 IS NOT INITIAL.

     SELECT VKBUR

            BEZEI

            FROM TVKBT INTO TABLE IT_TVKBT2

            FOR ALL ENTRIES IN IT_VBRK2

            WHERE VKBUR = IT_VBRK2-VKBUR

            AND SPRAS = 'EN'.

     SELECT SPART

            VTEXT

            FROM TSPAT INTO TABLE IT_TSPAT2

            FOR ALL ENTRIES IN IT_VBRK2

            WHERE SPART = IT_VBRK2-SPART

            AND SPRAS = 'EN'.

     SELECT KUNNR

            NAME1

            NAME2

            FROM KNA1 INTO TABLE IT_KNA12

            FOR ALL ENTRIES IN IT_VBRK2

            WHERE KUNNR = IT_VBRK2-KUNAG.

   ENDIF.

   LOOP AT IT_VBRK2 INTO WA_VBRK2.

     WA_FINALDET-FKDAT = WA_VBRK2-FKDAT.

     WA_FINALDET-SPART = WA_VBRK2-SPART.

     WA_FINALDET-NETWR = WA_VBRK2-NETWR.

     WA_FINALDET-KUNAG = WA_VBRK2-KUNAG.

     WA_FINALDET-KUNRG = WA_VBRK2-KUNRG.

     WA_FINALDET-SFAKN = WA_VBRK2-SFAKN.

     WA_FINALDET-VBELN = WA_VBRK2-VBELN.

*    wa_finaldet-erdat = wa_vbrk2-erdat.

     WA_FINALDET-VKBUR = WA_VBRK2-VKBUR.

     WA_FINALDET-POSNR = WA_VBRK2-POSNR.

     WA_FINALDET-MATNR = WA_VBRK2-MATNR.

     WA_FINALDET-ARKTX = WA_VBRK2-ARKTX.

     WA_FINALDET-FKIMG = WA_VBRK2-FKIMG.

     WA_FINALDET-VRKME = WA_VBRK2-VRKME.

ENDLOOP.

Read only

0 Likes
2,565

The ouput i am getting for this field value is 'TAG' but the user is entering like 'DAY'. So it has to be printed like that.

Regards,

Marina.

Read only

0 Likes
2,565

Hi Marina,

This is due to the conversion routine CUNIT assigned to the domain MEINS. To resolve this issue, while you populate the value to final internal table, check the following condition,

IF WA_VBRK2-VRKME EQ 'TAG'.

     WA_FINALDET-VRKME = 'DAY'.

ENDIF.

Hope this helps.


Thanks,

Shahanaz Hussain.

Read only

0 Likes
2,565

Hello Marina.

Such issues indicate that there is some conversion exit w.r.t that field.

if your report is of ALV kind,

     In your ALV field cat, give cfieldname as 'VRKME' and ctabname as 'VBRP'.

     If you had declared like that, automatic conversion exit happens.

For instance,

   FCAT-FIELDNAME = 'UNIT'.

   FCAT-SELTEXT_L = 'UNIT'.

   FCAT-CFIELDNAME = 'VRKME'.

   FCAT-CTABNAME = 'VBRP'.

   APPEND FCAT.

else.

      Find out the conversion exit and use it.

     SE11->Table->Double click the data element->Double click the domain->Double click the Convers. Routine


endif.


Regards.

Read only

0 Likes
2,565

Hi Marina,

The code seems to be fine. The values for VRKME field on pressing F4 shows 'day' as well as 'DAY'. Try debugging the code and see where the values are getting changed.

Regards,

Shahir Mirza

Read only

0 Likes
2,565

Dear Marina,

Pass your VBRP-VRKME(Sales unit) into Table T006A, MSEHI field SPRAS = 'EN'.

Hope this will resolve your issue.

Thanks and Regards,

bus_sap

Read only

0 Likes
2,565

Hi Marina,

I tried it is working fine...

have you declare data type like this or not

vrkme TYPE vbrp-vrkme,


Please share table and out put screen shots..

Read only

0 Likes
2,565

Any other permanent solution?

Read only

0 Likes
2,565

Hi Marina,

This problem only for DAY or for other also?

Read only

0 Likes
2,565

This message was moderated.

Read only

FredericGirod
Active Contributor
0 Likes
2,566

Hi Marina,

did you check if there is a field conversion exit on your domain VRKME ?

did you try the simple WRITE ...-VRKME TO ...  ?

regards

Fred

Read only

former_member209120
Active Contributor
0 Likes
2,565

Hi Marina,

use this to solve your problem

Try like this

SELECT  VBRK~FKDAT

         VBRK~SPART

         VBRK~NETWR

         VBRK~KUNAG

         VBRK~KUNRG

         VBRK~SFAKN

         VBRP~VBELN

         VBRP~VKBUR

         VBRP~POSNR

         VBRP~MATNR

         VBRP~ARKTX

         VBRP~FKIMG

         VBRP~VRKME

         INTO CORRESPONDING FIELDS OF TABLE IT_VBRK2

         FROM VBRP JOIN VBRK ON VBRP~VBELN = VBRK~VBELN

         WHERE VBRK~FKDAT IN SO_FKDAT.

   IF IT_VBRK2 IS NOT INITIAL.

     SELECT VKBUR

            BEZEI

            FROM TVKBT INTO TABLE IT_TVKBT2

            FOR ALL ENTRIES IN IT_VBRK2

            WHERE VKBUR = IT_VBRK2-VKBUR

            AND SPRAS = 'EN'.

     SELECT SPART

            VTEXT

            FROM TSPAT INTO TABLE IT_TSPAT2

            FOR ALL ENTRIES IN IT_VBRK2

            WHERE SPART = IT_VBRK2-SPART

            AND SPRAS = 'EN'.

     SELECT KUNNR

            NAME1

            NAME2

            FROM KNA1 INTO TABLE IT_KNA12

            FOR ALL ENTRIES IN IT_VBRK2

            WHERE KUNNR = IT_VBRK2-KUNAG.

   ENDIF.

   LOOP AT IT_VBRK2 INTO WA_VBRK2.

     WA_FINALDET-FKDAT = WA_VBRK2-FKDAT.

     WA_FINALDET-SPART = WA_VBRK2-SPART.

     WA_FINALDET-NETWR = WA_VBRK2-NETWR.

     WA_FINALDET-KUNAG = WA_VBRK2-KUNAG.

     WA_FINALDET-KUNRG = WA_VBRK2-KUNRG.

     WA_FINALDET-SFAKN = WA_VBRK2-SFAKN.

     WA_FINALDET-VBELN = WA_VBRK2-VBELN.

*    wa_finaldet-erdat = wa_vbrk2-erdat.

     WA_FINALDET-VKBUR = WA_VBRK2-VKBUR.

     WA_FINALDET-POSNR = WA_VBRK2-POSNR.

     WA_FINALDET-MATNR = WA_VBRK2-MATNR.

     WA_FINALDET-ARKTX = WA_VBRK2-ARKTX.

     WA_FINALDET-FKIMG = WA_VBRK2-FKIMG.

     WA_FINALDET-VRKME = WA_VBRK2-VRKME.

CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'

  EXPORTING

   input                = WA_VBRK2-VRKME

    LANGUAGE             = SY-LANGU

IMPORTING

  •   LONG_TEXT            =

   OUTPUT               = WA_FINALDET-VRKME

  •   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.

ENDLOOP.

Read only

koolspy_ultimate
Active Contributor
0 Likes
2,565

Hi,

   Check ISOCODE in table T006.

Enter MSEHI = 'TAG' and you will get 'DAY' in the ISOFIELD.

(or)

use CONVERSION_EXIT_CUNIT_OUTPUT , already mentioned by

Regards,

Madhumahesh.