Skip to Content
avatar image
Former Member

call a BAPI and set table ...

Into my BPS application, I have to call a BAPI. I have to set two tables (Sales organisation and materialselection). If I test my ZBAPI with SE37 with the same parameter it works. But I call my BAPI by a BSP using a RFC, my table ZMATNRLST is empty ...

My code :

-


*Required Data Definition to set SALESORGANISATIONSELECTION INTO BAPI

*CALLING

data: ZSALESORG type SALESORGANISATIONSELECTION.

data: WA_ZSALESORG type BAPIMATRASO.

WA_ZSALESORG-SIGN = 'I'.

WA_ZSALESORG-OPTION = 'EQ'.

WA_ZSALESORG-SALESORG_LOW = '7002'.

APPEND WA_ZSALESORG TO ZSALESORG.

*Required Data Definition to set SALESORGANISATIONSELECTION INTO BAPI

*CALLING

data: ZMATSELECT type MATNRSELECTION.

data: WA_ZMATSELECT type BAPIMATRAM.

WA_ZMATSELECT-SIGN = 'I'.

WA_ZMATSELECT-OPTION = 'CP'.

WA_ZMATSELECT-MATNR_LOW = '*'.

APPEND WA_ZMATSELECT TO ZMATSELECT.

  • Call Example

CALL FUNCTION 'Z_B2B_BAPI_MATERIAL_GETLIST'

DESTINATION 'SD1CLNT140'

EXPORTING

MAXROWS = 100

TABLES

MATNRSELECTION = ZMATSELECT

  • MATERIALSHORTDESCSEL = MATERIALSHORTDESCSEL

  • MANUFACTURERPARTNUMB = MANUFACTURERPARTNUMB

  • PLANTSELECTION = PLANTSELECTION

  • STORAGELOCATIONSELECT = STORAGELOCATIONSELECT

SALESORGANISATIONSELECTION = ZSALESORG

  • DISTRIBUTIONCHANNELSELECTION = DISTRIBUTIONCHANNELSELECTION

MATNRLIST = ZMATNRLST.

  • RETURN = RETURN

data: nblines type N.

DESCRIBE TABLE ZMATNRLST LINES nblines.

if nblines = 0.

MESSAGELIST = 'EMPTY CATALOG'.

else.

MESSAGELIST = 'NUMBER OF MATERIAL = '.

CONCATENATE MESSAGELIST NBLINES INTO MESSAGELIST.

endif.

-


Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 10, 2004 at 01:29 PM

    Hi.

    I sugest to do a trace or a debugging to your RFC Function Module or to revise the atributes.

    regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2004 at 07:55 PM

    You don't have EXCEPTIONS in the CALL FUNCTION. So, probably you are not even hitting the destination target 'SD1CLNT140'. Check your SM59 definition and make sure the target is reachable. Also, include an exception and check it out.

    Regards,

    <b>Venky Varadadesigan</b>

    SAP NetWeaver consulting.

    Add comment
    10|10000 characters needed characters exceeded