Skip to Content
0
Jul 02, 2007 at 06:41 PM

Question conserning a remote-enabled BAPI

13 Views

I have created a quick and 'easy' BAPI that will return a table of shipping document numbers. The code is below:

FUNCTION z_bapi_likp_get_list.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(ZBAPI_DELIVERY_DOC_IMPORT) TYPE  ZBAPI_DELIVERY_DOC_IMPORT
*"  EXPORTING
*"     VALUE(ZBAPI_DELIVERY_DOC_EXPORT) TYPE  ZBAPI_DELIVERY_DOC_EXPORT
*"     VALUE(RETURN) TYPE  BAPIRETURN
*"----------------------------------------------------------------------

  SELECT vbeln FROM likp INTO zbapi_delivery_doc_export
    WHERE lddat = zbapi_delivery_doc_import-lddat AND
          vstel = zbapi_delivery_doc_import-zzvstel.
  ENDSELECT.


ENDFUNCTION .

ZBAPI_DELIVERY_DOC_IMPORT is a structure that contains two fields: LDDAT and VSTEL

ZBAPI_DELIVERY_DOC_EXPORT is a structure that contains one field: VBELN. I tried to follow and it seemed to work great but I have a slight 'problem'.

I need to include the leading zeros on the document numbers. I tried to loop through the structure (after the select) and append the zeros that way but it wasn't allowing me to loop through the structure. Does anybody have any ideas/suggestions?this" target="_blank">http://www.erpgenie.com/abap/bapi/example.htm">this step-by-step example