Skip to Content
author's profile photo Former Member
Former Member

HI BAPI IS NOT WORKING

HI TO ALL,

IM STILL LEARNING BAPIS I HAVE WRITTEN A SIMPLE CODE TO GET CUSTOMER LIST USING BAPI_CUSTOMER_GETLIST.

IT HAS RANGES TABLE THAT I HAVE INITIALIZED TABLE AS

SIGN = 'I'.

OPTION = 'EQ'.

LOW = '1'.

HIGH = '5000'.

IM PASSING THAT RANGES TABLES TO BAPI_FUNCTION_MODULE

BUT IM GETTING THE LAST 10 CUSTOMER RECORDS IN DATABASE FROM

1000000000 TO 1000000039

WHAT I HAVE DONE WRONG.

IM STILL LEARNING BAPIS

HERE IS MY CODE

REPORT ZBAPI_CUTOMER_CREATE.

TABLES : KNA1.

DATA:BEGIN OF IT_CUST OCCURS 0.

INCLUDE STRUCTURE BAPICUSTOMER_IDRANGE.

DATA: END OF IT_CUST.

***

SELECT-OPTIONS : SO_CUST FOR KNA1-KUNNR.

DATA :BEGIN OF IT_RETURN OCCURS 0.

INCLUDE STRUCTURE BAPIRETURN1.

DATA: END OF IT_RETURN.

DATA: BEGIN OF IT_ADDRESS OCCURS 0.

INCLUDE STRUCTURE BAPICUSTOMER_ADDRESSDATA.

DATA : END OF IT_ADDRESS.

DATA: BEGIN OF IT_specialdata OCCURS 0.

INCLUDE STRUCTURE BAPICUSTOMER_SPECIALDATA.

DATA : END OF IT_SPECIALDATA.

INITIALIZATION.

SO_CUST-SIGN = 'I'.

SO_CUST-OPTION = 'BT'.

SO_CUST-LOW = '1'.

SO_CUST-HIGH = '5000'.

APPEND SO_CUST.

LOOP AT SO_CUST.

MOVE-CORRESPONDING SO_CUST TO IT_CUST.

APPEND IT_CUST.

ENDLOOP.

START-OF-SELECTION.

CALL FUNCTION 'BAPI_CUSTOMER_GETLIST'

  • exporting*

  • MAXROWS = max*

  • CPDONLY = 'X'*

IMPORTING

RETURN = IT_RETURN

TABLES

IDRANGE = IT_CUST

ADDRESSDATA = IT_ADDRESS

SPECIALDATA = it_specialdata

.

LOOP AT IT_ADDRESS.

WRITE:/ IT_ADDRESS-CUSTOMER,IT_ADDRESS-SORT1, IT_ADDRESS-COUNTRY,IT_ADDRESS-CITY.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 29, 2008 at 03:56 PM

    Change your range filling leading zero in internal value (You are not in transaction with external values and conversion exit)

    >SIGN = 'I'.

    >OPTION = 'EQ'.

    >LOW = '0000000001'.

    >HIGH = '0000005000'.

    Or use Function Module to convert input data to internal format : CONVERSION_EXIT_ALPHA_INPUT associated with domain KUNNR.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.