07-12-2010 11:03 AM
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
07-12-2010 11:11 AM
07-12-2010 11:11 AM
07-12-2010 11:21 AM
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
07-12-2010 11:39 AM
During Debugging , did you saw the values in the table ZPRUEBA_CRM?
Check both the structure in CRM and R3 are same?
07-12-2010 11:42 AM
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
07-12-2010 11:58 AM
Hi Jon,
it is strange but could you please confirm that ZCRM_PRUEBA has been marked as Pass Value on Export parameters?
Regards,
Carlos.
07-12-2010 11:59 AM
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
07-12-2010 12:19 PM
I checked that is pass value and i also tried to put the IT with [] but nothing
07-12-2010 1:15 PM
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.
07-12-2010 2:21 PM