Application Development 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: 

Can't get ddic type of input parameter in conversion exit called from cl_salv_table

former_member210008
Active Participant
0 Kudos
460

Hi all.

Here is my problem: I have field in table with fixed domain values. I can get texts for values with FM DD_DOMVALUES_GET.

I created CONVERSION_EXIT_ZXCVB_OUTPUT to get text by value.

But when I add conversion exit to salv table salv->get_columns()->get_column('column_name')->set_edit_mask('==ZXCVB') it doesn't work.

If I call FM directly it works.

For example:


data field type xfeld.

data output type string.

field = 'X'.

call function 'CONVERSION_EXIT_ZXCVB_OUTPUT'

     exporting

          input = field

     importing

          output = output.

output contains YES. All ok.

Here is FM


FUNCTION CONVERSION_EXIT_ZXCVB_OUTPUT.

*"----------------------------------------------------------------------

*"*"Локальный интерфейс:

*"  IMPORTING

*"     REFERENCE(INPUT)

*"  EXPORTING

*"     VALUE(OUTPUT)

*"----------------------------------------------------------------------

  DATA(TD) = cl_Abap_typedescr=>DESCRIBE_BY_DATA( input ).

  IF td->IS_DDIC_TYPE( ).

    DATA domname TYPE domname.

    DATA DD07V_TAB     TYPE STANDARD TABLE OF DD07V.

    domname = td->GET_RELATIVE_NAME( ).

    CALL FUNCTION 'DD_DOMVALUES_GET'

      EXPORTING

        DOMNAME              = DOMNAME

       TEXT                 = 'X'

       LANGU                = sy-langu

      TABLES

        DD07V_TAB            = DD07V_TAB

     EXCEPTIONS

       WRONG_TEXTFLAG       = 1

       OTHERS               = 2

              .

    IF SY-SUBRC <> 0.

      exit.

    ENDIF.

    output = VALUE #( dd07v_tab[ DOMVALUE_L = input ]-ddtext DEFAULT input ).

  ELSE.

    output = input.

  ENDIF.

ENDFUNCTION

.

I checked fm in debug. When direct call, TD->ABSOLUTE_NAME = \TYPE=XFELD

When it called from salv via edit mask TD->ABSOLUTE_NAME =\TYPE=%_T00006S00000000O0000000291.

Any hints?

PS

I know that I can set INPUT parameter with current type, but I want universal FM.

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
159

After debug, I see that the system loses the data type in subroutine CONVERSION_EXIT of SAPCNVE, after this call:

  CALL 'AB_GET_C_PARMS' ID 'P1' FIELD <FNAME>     "Abholen der
                        ID 'P2' FIELD <INPUT>     "Parameter aus
                        ID 'P3' FIELD <OUTPUT>.   "der C-Welt

So, I guess it's impossible to overcome this issue by continueing in your direction. Did you try playing with dropdown listboxes instead?

6 REPLIES 6

Sandra_Rossi
Active Contributor
0 Kudos
160

After debug, I see that the system loses the data type in subroutine CONVERSION_EXIT of SAPCNVE, after this call:

  CALL 'AB_GET_C_PARMS' ID 'P1' FIELD <FNAME>     "Abholen der
                        ID 'P2' FIELD <INPUT>     "Parameter aus
                        ID 'P3' FIELD <OUTPUT>.   "der C-Welt

So, I guess it's impossible to overcome this issue by continueing in your direction. Did you try playing with dropdown listboxes instead?

0 Kudos
159

What will I get from listboxes? There is no need to pick up values, only replace codes with texts without adding new column and abap code to fill it. Or I misunderstood you?

0 Kudos
159

it's not to pick up values, it's to automatically display texts based on values; it's optimized as you send the list of pairs { value , text } only once, and it's handled at the frontend. The drawback is that the dropdown button takes a little space. But that's just an idea, I never tried it.

0 Kudos
159

Just checked dropdowns - it doesn't work in fullscreen salv

How did you get into CONVERSION_EXIT? Break point doesn't work and I can't reach it in debug.

0 Kudos
159

Just checked dropdowns - it doesn't work in fullscreen salv

It does not surprise me (same "problem" as for editing feature and context menu, SAP never wanted to release these features which are available in ALV grid, and that they use in standard programs; people have found workarounds to get the ALV grid control and play with it ... for instance http://scn.sap.com/community/abap/blog/2015/08/07/salv-and-pepper-editing-individual-columns-in-the-... )


How did you get into CONVERSION_EXIT? Break point doesn't work and I can't reach it in debug.

Break-points work in conversion exits with the new debugger (choose it using the settings)

0 Kudos
159

Found my problem - system debug was disabled. That is why I missed a lot of calls.