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: 

problems retrieving data from CRM calling R/3 FM

Former Member
0 Kudos

Hi guys,

I have created a FM in R/3 that retrieves data to show on CRM.

The FM is executed correctly but when i call it from CRM, the internal table that i obtain from the FM is empty.

Here is the code of the FM,

*"----------------------------------------------------------------------
*"*"Interfase local
*"  IMPORTING
*"     VALUE(LD_PARTNER) TYPE  KUNNR
*"  EXPORTING
*"     VALUE(ZPRUEBA_CRM) TYPE  ZPRUEBA_TAB
*"     VALUE(RETURN) TYPE  CHAR1
*"----------------------------------------------------------------------

DATA wa_mat type zprueba_line.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
  EXPORTING
    input         = LD_PARTNER
 IMPORTING
   OUTPUT        = LD_PARTNER.

SELECT * FROM zprueba
  INTO CORRESPONDING FIELDS OF TABLE ZPRUEBA_CRM
  WHERE bp_number EQ LD_PARTNER.

IF sy-subrc ne 0.
  return = 'A'.
else.
  return = 'X'.
ENDIF.

i also return the variable return to see if the select was correct, and in debugging i can see that return has X value, so the query is correct.

Any idea?

Best regards

Jon

1 ACCEPTED SOLUTION

former_member182387
Active Participant
0 Kudos

Hi,

Can you please give me the structure details of ZPRUEBA_TAB.

9 REPLIES 9

former_member182387
Active Participant
0 Kudos

Hi,

Can you please give me the structure details of ZPRUEBA_TAB.

0 Kudos

Yes, here it is,

ZPRUEBAS_TAB IS A TABLE TYPE of structute zprueba_line, that has this fields.

MANDT type MANDT

BP_NUMBER type KUNNR

MATNR TYPE MATNR

0 Kudos

During Debugging , did you saw the values in the table ZPRUEBA_CRM?

Check both the structure in CRM and R3 are same?

0 Kudos

In debugging i can see the value of return variable but not the internal table value.

It was supposed to have 3 register but it does not show them.

The X value shows that the query is being executed correctly.

BEst Regards

Jon

0 Kudos

Hi Jon,

it is strange but could you please confirm that ZCRM_PRUEBA has been marked as Pass Value on Export parameters?

Regards,

Carlos.

0 Kudos

Check both the structure in CRM and R3 are same?

If both are same means, try using [] for the internal table used to collect the values from the FM

like

CALL FUNCTION 'ZRFC_R3'
  EXPORTING
    LD_PARTNER        =  W_PARTNER
 IMPORTING
    ZPRUEBA_CRM    = IT_ZPRUEBA_CRM[]
    RETURN               =     w_RETURN.

Edited by: Senthil Kumar on Jul 12, 2010 4:29 PM

0 Kudos

I checked that is pass value and i also tried to put the IT with [] but nothing

0 Kudos

Hi Jon,

can I suggest you 2 things?

first one, is it possible to you, use TABLES instead of EXPORTING?

second one, in CRM, when you are implementing the call to the fm, the internal table might have the same name?

CALL FUNCTION 'XXXX' DESTINATION xxx

EXPORTING

LD_PARTNER = LD_PARTNER

IMPORTING

ZPRUEBA_CRM = ZPRUEBA_CRM

RETURN = RETURN.

Regards,

Carlos.

0 Kudos

yes i did that and it works!!

Thanks