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

problems retrieving data from CRM calling R/3 FM

Former Member
0 Likes
1,251

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
Read only

Former Member
0 Likes
1,216

Hi,

Can you please give me the structure details of ZPRUEBA_TAB.

9 REPLIES 9
Read only

Former Member
0 Likes
1,217

Hi,

Can you please give me the structure details of ZPRUEBA_TAB.

Read only

0 Likes
1,216

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

Read only

0 Likes
1,216

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

Check both the structure in CRM and R3 are same?

Read only

0 Likes
1,216

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

Read only

0 Likes
1,216

Hi Jon,

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

Regards,

Carlos.

Read only

0 Likes
1,216

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

Read only

0 Likes
1,216

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

Read only

0 Likes
1,216

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.

Read only

0 Likes
1,216

yes i did that and it works!!

Thanks