Domain
» See all 1203 related threads
May 06 26

function module on KONV  

02:51 // Boujema Bouhazama

Hi there

Table KONV is a cluster table.

I have already created a datasource on this table with an infoset linking it with ekko, but I expect to face performance issues as the table KONV has many records.

Therefore I would like to create a function module linking KNUMV from ekko and konv.

Here is what i have done but when create the datasource i am getting an error. Could you please provide your help in solving this issue. Thanks in advance.

    TABLES: konv.

  DATA: l_s_select TYPE srsc_s_select.

  STATICS: s_s_if TYPE srsc_s_if_simple,

  s_counter_datapakid LIKE sy-tabix,

  s_cursor TYPE cursor.

  RANGES: l_r_knumv FOR konv-knumv,

  l_r_kposn FOR konv-kposn,

  l_r_kschl FOR konv-kschl,

  l_r_waers FOR konv-waers.

  l_r_kntyp for konv-kntyp.

  l_r_kruek for konv-kruek.

  l_r_kwert for konv-kwert.

  IF i_initflag = sbiwa_c_flag_on.

    IF NOT g_flag_interface_initialized IS INITIAL.

      IF 1 = 2. MESSAGE e008(r3). ENDIF.

      log_write 'E' "message type

      'R3' "message class

      '008' "message number

      ' ' "message variable 1

      ' '. "message variable 2

      RAISE error_passed_to_mess_handler.

    ENDIF.

    APPEND LINES OF i_t_select TO s_s_if-t_select.

    s_s_if-requnr = i_requnr.

    s_s_if-dsource = i_isource.

    s_s_if-maxsize = i_maxsize.

    g_s_interface-initflag = i_initflag.

    g_s_interface-updmode = i_updmode.

    g_s_interface-datapakid = i_datapakid.

    g_flag_interface_initialized = sbiwa_c_flag_on.

    APPEND LINES OF i_t_fields TO s_s_if-t_fields.

  ELSE.

    IF s_counter_datapakid = 0.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = ' KNUMV

        MOVE-CORRESPONDING l_s_select TO l_r_knumv.

        APPEND l_r_knumv.

      ENDLOOP.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = KPOSN

        MOVE-CORRESPONDING l_s_select TO l_r_kposn.

        APPEND l_r_kposn.

      ENDLOOP.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = KSCHL

        MOVE-CORRESPONDING l_s_select TO l_r_kschl.

        APPEND l_r_kschl.

      ENDLOOP.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = WAERS

        MOVE-CORRESPONDING l_s_select TO l_r_waers.

        APPEND l_r_waers.

      ENDLOOP.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'kntyp'.

        MOVE-CORRESPONDING l_s_select TO l_r_kntyp.

        APPEND l_r_kntyp.

      ENDLOOP.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'kRUEK'.

        MOVE-CORRESPONDING l_s_select TO l_r_kruek.

        APPEND l_r_kruek.

      ENDLOOP.

      LOOP AT s_s_if-t_select INTO l_s_select WHERE fieldnm = 'kWERT'.

        MOVE-CORRESPONDING l_s_select TO l_r_kwert.

        APPEND l_r_kwert.

      ENDLOOP.

      OPEN CURSOR WITH HOLD s_cursor FOR

      SELECT (s_s_if-t_fields) FROM KONV

      WHERE KNUMV IN l_r_knumv AND

      KPOSN IN l_r_kposn AND

      KSCHL IN l_r_kschl AND

      WAERS IN l_r_waers AND

      kntyp IN l_r_kntyp AND

      kruek IN l_r_kruek AND

      kwert IN l_r_kwert.

    ENDIF.

    FETCH NEXT CURSOR s_cursor

    APPENDING CORRESPONDING FIELDS

    OF TABLE e_t_data

    PACKAGE SIZE s_s_if-maxsize.

    IF sy-subrc <> 0.

      CLOSE CURSOR s_cursor.

      RAISE no_more_data.

    ENDIF.

    s_counter_datapakid = s_counter_datapakid + 1.

  ENDIF.

ENDFUNCTION.

Regards

Boujema

 
May 06 26

Re: function module on KONV  

06:09 // Pradip Patil

Hello

please have a look at following thread

Re: Select from KONV using Additional Code in ABAP Query

May 06 26

Re: function module on KONV  

06:43 // Anil Kumar

Hi,

Have you defined the Extraction structure in Se11 and are you using that in Generic datasource?

With rgds,

Anil Kumar Sharma .P

May 06 26

Re: function module on KONV  

15:19 // Boujema Bouhazama

Hi Pradip

Thanks for your help but the post you gave me deals with another suject.

Regards

May 06 26

Re: function module on KONV  

15:23 // Boujema Bouhazama

Hi Anil thank you for your reply

Yes I have already create a structure based on the fields that you can see in the code. And yes it is a generic datasource, but you are right to ask it as I didn't mention where i get the error message.

I get an error message when i test the extraction.

Does anybody have an idea !!?! Thanks in advance for your help.

Regards

Boujema

May 06 26

Re: function module on KONV  

15:24 // Oscar Romero

what error are you getting?

May 06 26

Re: function module on KONV  

15:27 // Boujema Bouhazama

Hi Oscar

I am getting this error

Error 6 in function module RSS_PROGRAM_GENERATE

May 06 26

Re: function module on KONV  

15:35 // Oscar Romero

Your source code is that exactly? i copy it into my system and it has syntax errors...

May 06 26

Re: function module on KONV  

15:40 // Boujema Bouhazama

yes Oscar my code is exactly like this.

I can't find exactly what and where the error is

Could you please help me in correcting it

I Thank you in advance.

Regards

May 06 26

Re: function module on KONV  

15:49 // Oscar Romero

in source editor press ctrlF2 (check syntax) if ok then activate FM pressing ctrlF3.

RANGES: l_r_knumv FOR konv-knumv,

l_r_kposn FOR konv-kposn,

l_r_kschl FOR konv-kschl,

l_r_waers FOR konv-waers.

l_r_kntyp for konv-kntyp.

l_r_kruek for konv-kruek.

l_r_kwert for konv-kwert.

Finish all sentences with comma except the last one.

May 06 26

Re: function module on KONV  

16:04 // Boujema Bouhazama

Hi Oscar when checking the source code it is telling me SRSC_S_IF_SIMPLE is unknown.

May 06 26

Re: function module on KONV  

17:06 // Boujema Bouhazama

Seemingly I have a pb with the function group some parts are missing thanks to all anyway

Regards

Date Views Headline Answers
28.01.2013 148 Smartform debugging issue 25
28.01.2013 202 Net price in decimals 12
27.01.2013 118 purchase order with planned delivery cost 5
24.01.2013 49 Pricing values source 5
18.01.2013 53 KONV - alternative selection 3
28.12.2012 636 Regarding Pricing condition tables 21
27.12.2012 115 How to find condition record number for a scheduling agreement in MM(me33l) 2

Feedback