Import returns

Hi,
I've a problem. Our client imports material. We create import PO, with import pricing proc.After paying duties n other charges, at the time of GRN, we found that few of them are not ok. So now we want to return it to vendor in Japan. How to map this in SAP. What about the duties? I've followed the procedure in following sequence- ME21N>MIRO9planned del cost>J1IEX>MIGO>J1IEX_P-->MIRO (main Vendor).
Please correct me if I'm mistaking.
Will anybody please explain me in detail as I'm confused.
Regards,
Piyush

Hi,
- Perform the MIRO for custom duty.
- Capture the BOE.
- Perform the goods receipt.
- Move the stock from unrestricted to block storage location.
- Inform the excise n customs that u need to return the goods back to country of origin.
- When you get the required signal to re-export, move the goods to unrestricted location.
- Perform 122 movement type for return of inventory
- Take the material document of 122 movement type, select Excise tran type as MATD and select the duty to be reversed back.
- Post the invoice, it will assign the running invoice number to it, its Sale invoice but it is not booking revenue a/c's.
- Apply for the imports duty rebate with local excise department.
- Thru finance pass credit note for imports duties paid.

Similar Messages

  • Howto map to an odata model function import returning an entity, not an entity set?

    Hi,
    how do I map to an odate model function import returning an entity (not an entity set) in a XML view? I tried property mapping {/method/property}, which does not make a network request and sets the value to null and I tried aggregation mapping {/method}, which makes a network request with $skip=0&$top=100&$inlinecount=allpages which is of course rejected by the odata source.
    Thanks,
    Wolfgang

    Hello Dr. Wolfgang,
    you can use
      var oParams = {};
      oParams.Field1 = 'ABC';
      oParams.Field2= 'XYZ';
      oParams.Field3= '123';
      oModel.callFunction('MyFuncImport', 'GET', oParams, null, function(oResponse){
            alert("Call to Func Imp successful");
        },function(){
            alert("Call to Func Imp failed");});
    also refer SAPUI5 SDK - Demo Kit
    Regards,
    Chandra

  • How to handle Import Return

    Hi,
        Can anybody tell me the import return process with account Entries at all steps.
    Thanks in advance.
    Regards
    Pavan

    Gurus,
         Any Help Regarding this issue.

  • Import return

    hi sap guru
    I just want know return import material senario in sap ,how we can return import material back to vendor
    when creation of return po system showing nagative delivary cost  massage
    so how can i return import material to vendor and account entries should be revers properlly
    and what about custom duty and cvd cost they also revrs or not please clarify
    thank

    Hi
    Provide the complte error message you are getting in Return PO
    The Vendor can also be made using MB1B 124 or 122 mvt, followed by J1IS, MATD (this will give excise Invoice need to be send along with the material)
    Do you mainatin AED or SED seprate in your register?
    Is Invoice verification also done for the PO?
    Niti Narayan

  • TCS 3 FrameMaker DItamap import returns "Failed to get any FrameMaker document from"

    Hi,
    I recently aquired the TCS 3 and I am trying to build a help project using a ditamap.  I was able to do this once, but I ended up scrapping the project fbacause FrameMaker ran out of memory when I tried to update the project.
    Now, I see this error when I try to import or link my ditamap to a new project.
    I followed the steps as shown in the Robohelp docs.
    Any thoughts on things I need to do to fix this.
    RH 9 did crash once, could there be some garbage cleanup I need to do?
    Is there other info I can pass on that may help?
    Lauren

    OK.  Is there a Best Practices approach to the procedure?  And yes, I am assuming that it will be more complicated than just using the Windows uninstall function. 

  • TP IMPORT returns job close failed

    we just refreshed our crm qa system from prod. since then i  have not been able to get the mass transport(large trunk) to work. when i enter the client, start date/time, and the period i get the following message:
    System   CQ1              Command  TMS_MGR_IMPORT_TR_QUEUE       
    Client   100              Service  TMS Batch Control             
    User     TMSADM           Start    Hintergrund                   
    Date     09/07/2006       Function TMS_BCI_JOB_CREATE            
    Time     10:00:59         Message  TMS_BCI_JOB_CLOSE_FAILED                                                                               
    Release of TMS_0000000027TMS_TP_IMPORT in QA1 system    failed with return code job_close_failed                                                                               
    we are not able to do any automatic transports. any help would be greatly appreciated.
    thank you

    Hi Dolores,
    I think your question should better be put within a technology part of the sdn forums, this forum is for business process experts, there might not be that much help here...
    Did you reconfigure the transport landscape after the system copy P --> Q? Please check from STMS that the config is still correct (transdir etc.).
    but, well: the techies might be of more help to you...
    kind regards,
    Carl

  • Operating System request Import return code has different return code from SAP SE01 log screen.

         Hi experts.
         I sent request from DEV system to PRD system at OS level but I am facing interesting problem. I sent request at OS level and return code 8, that means with error but if we look same request transporter log  at SAP side vi tranzaction SE01, Transporter log show me no error. I did not test with return code 0(zero), 4 or 12 at OS level.
    Our OS  is SOLARIS 11.2 and Database Oracle 11G and SAP Netweaver 7.40.
    Thank for help.

    Read what you have posted:
    Alternatively, you can find these logs in the following files in the
    log directory of your transport directory (usually:
    /usr/sap/trans/log):
    - tp Step 6: P<YY><MM><DD>.<SID>
    - tp Step N: N<YY><MM><DD>.<SID>
    - tp Step S: DS<YY><MM><DD>.<SID>
    Sort the files by date and check the latest one.
    Markus

  • Getting Return values from RFC function call with visual basic

    Hi,
    I am creating a sample app to connect to a SAP system which call its RFC functions created with ABAP. It was known that the function will return more than 1 return values.
       SAP Function name ==> "ZFMTP_RFC_GET_RESULT"
            Export parameters (to SAP):
                    - Student Name [char 10]         ==> "STUNAME"
                    - Student ID         [char 20]        ==> "STUID"
           Return values (From SAP):
                    - Results [char 10]        ==> "RESULT"
                    - Remarks [char 200]        ==> "REMARKS"
    i have managed to get sample codes for connecting and call a RFC function with vb but they only get a return value. How do i retrieve multiple return values like the above function "RESULT" and "REMARKS"?
    Here's my vb code to accessing the function
            Dim R3 As Object
            Dim FBFunc As Object
            Dim returnFunc As Boolean
            Dim connected As Boolean
            R3 = CreateObject("SAP.Functions")
            R3.Connection.Client = "000"
            R3.Connection.User = "BCUSER"
            R3.Connection.Password = "minisap"
            R3.Connection.Language = "DE"
            R3.Connection.System = "dtsystem"
            R3.Connection.Applicationserver = "xxx.xxx.xxx.xxx" 
            connected = R3.Connection.Logon(0, True)
            If connected <> True Then
                MsgBox("Unable to connect to SAP")
            End If
            FBFunc = R3.add("ZFMTP_RFC_GET_RESULT")
            FBFunc.exports("STUNAME") = "Jonny"
            FBFunc.exports("STUID") = "12345"
            returnFunc = FBFunc.Call() <<== How do i get the return value? or RESULT and REMARKS of the RFC Function?
    thanks alot.
    Edited by: Eugene Tan on Mar 4, 2008 7:17 AM

    Hi Gregor,
    Thanks for the link....i am having some doubts with the codes, hope you can clarify them for me if you know the codes..
    Below is the code snippet.
    Set impReturn = CHPASS_FN.Imports("RETURN")  <<=== is RETURN the standard keyword to get a                                                                                return object?
      expPassword.Value = currpass
      expNewPass.Value = newpass
      expFillRet.Value = "1"
    ''' Call change password function
      If CHPASS_FN.Call = True Then
        outFile.Write (", Called Function")
        Message = impReturn("MESSAGE") <<==== So if i have 3 return values..i just replace with the return                                                               value variable names?
        outFile.WriteLine " : " & Message
      Else
        outFile.Write (", Call to function failed")
      End If
    thanks alot...all your help is very appreciated.

  • How to use select-options in the function module of import parameter ?

    Hi ...
       I have created a BAPI and tested in SWO1 tcode , by giving the single value for an company code ( BUKRS ) , it executed properly .
    Same thing is working after implementing in a program .
    so now it is working for fetching a single company code details .
    My requirement is : I want to use select-options in program as well as in function module IN IMPORT PARAMETER.
    Program :
    REPORT  ZTEST.
    TABLES : T001 , ZBAPI_STR .
    TYPES : BEGIN OF TY_ITEM  .
              INCLUDE STRUCTURE ZBAPI_STR .
    TYPES : END OF TY_ITEM .
    DATA :WA_ITEM TYPE TY_ITEM ,
          ITEM LIKE STANDARD TABLE OF WA_ITEM INITIAL SIZE 0 .
    PARAMETER : BUKRS TYPE ZBAPI_STR-BUKRS.
    call function 'ZBAPI_FMT001'
      exporting
        bukrs         =  BUKRS
    IMPORTING
      RETURN        =
      tables
        itemtab       = ITEM
    IF ITEM IS NOT INITIAL .
      LOOP AT ITEM INTO WA_ITEM .
        WRITE : / WA_ITEM-BUKRS , WA_ITEM-BUTXT , WA_ITEM-ORT01 , WA_ITEM-LAND1 .
      ENDLOOP.
    ENDIF.
    FUNCTION MODULE :
    FUNCTION ZBAPI_FMT001.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(BUKRS) TYPE  EFG_TAB_RANGES
    *"  EXPORTING
    *"     VALUE(RETURN) TYPE  BAPIRET2
    *"  TABLES
    *"      ITEMTAB STRUCTURE  ZBAPI_STR
    SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE ITEMTAB WHERE BUKRS = BUKRS .
    ENDFUNCTION.
    Regards
    Deepa.

    I have given a similiar example which i did
    Declare a
    Table type:Z_TT_PONUM             
    Short text  :  Select options  PO Number
    in SE11 tcode with row type eg: Z_ST_PONUM
    create a structure (this will be the row type)
    Structure          Z_ST_PONUM            
    Short text         Select Options Field PO number
    Compenent  Compent type
    SIGN       BAPISIGN      Inclusion/exclusion criterion SIGN for range tables
    OPTION       BAPIOPTION      Selection operator OPTION for range tables
    LOW       EBELN                      Purchasing Document Number
    HIGH       EBELN                      Purchasing Document Number
    In the function module import
    give as
    I_PO_NUM     TYPE     Z_TT_PONUM     opt  pass value Select options  PO Number
    Hope this is exactly what you want to know.
    So you create a structure simliar to mine but the low an high whould be your component
    then a table type  and then include that in the BAPI.
    Then pass your select-option value to this BAPI when you call this BAPI in the program

  • Function module import parameter

    I had used a bapi in the program and i got a dump.
    then i recetified the dump. But kindly tell me the
    reason .
    My program is like this..
    Report xyz.
    DATA wa_bapireturn TYPE bapireturn.
    DATA it_bapireturn LIKE TABLE OF  wa_bapireturn.
    DATA wa_bapisdstat TYPE bapisdstat.
    DATA it_bapisdstat LIKE TABLE OF  wa_bapisdstat.
    PARAMETERS p_vbeln LIKE vbap-vbeln.
    START-OF-SELECTION.
      CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
        EXPORTING
          salesdocument = so_vbeln
        IMPORTING
          return        = it_bapireturn
        TABLES
          statusinfo    = it_bapisdstat.
    now i got the dump because i have used
    it_bapireturn for importing.
    then i modified the program like..
    CALL FUNCTION 'BAPI_SALESORDER_GETSTATUS'
        EXPORTING
          salesdocument = so_vbeln
        IMPORTING
          return        = wa_bapireturn
        TABLES
          statusinfo    = it_bapisdstat.
    Now the program working fine because i passed
    wa_bapireturn. please tell me why it happened like
    this. How to know when to pass internal table and when to
    pass just a structure.
    And also tell me the difference bet type and type ref to.

    As per the interface definition of the BAPI, it expects one workarea in the RETURN parameter.
    but it_bapireturn was an internal table so was the dump
    but wa_bapireturn is a work area so it worked.
    You can check the interface of the Function Module to know what to be used. Usually work areas are passed in IMPORT AND EXPORT parameters and internal tables in TABLES parameters.
    by using TYPE , we create a variable of a pre difined TYPE.
    by using TYPE REF we create object of a particual class
    Edited by: Swastik Bharati on Aug 21, 2008 2:16 PM

  • CJ20N - project structure and data import

    Hello dear SAP specialists,
    Does anybody ever created a ABAP program to import project structure and populate it with data?
    I'm trying to start with something or get a working program to import some projects with data.
    Actually the program should use BAPI_PROJECT_MAINTAIN to create WBS and GUI_UPLOAD to read a text (cvs) file (LSMW can not be used:)
    Sincerely,
    Me

    Hi,
    Exactly!
    See you have so many tables in that BAPI, now all the data you have in your flat file you have to map to these tables.
    Below is a code...similarly you'll have to do
    TYPE-POOLS: truxs.
    *                           T Y P E S
    TYPES: BEGIN OF t_master_data,
              MATERIAL                      Type  MATNR ,
              IND_SECTOR                    Type  MBRSH ,
              MATL_TYPE                     Type  MTART ,
              PLANT                         Type  WERKS ,
              STGE_LOC                      Type  LGORT_D ,
              MATL_DESC                     Type  MAKTX ,
              BASE_UOM                      Type  MEINS ,
              MATL_GROUP                    Type  MATKL ,
              DIVISION                      Type  SPART ,
              ITEM_CAT                      Type  MTPOS_MARA  ,
              GROSS_WT                      Type  BRGEW ,
              UNIT_OF_WT                    Type  GEWEI ,
              NET_WEIGHT                    Type  NTGEW ,
              VOLUME                        Type  VOLUM ,
              SIZE_DIM                      Type  GROES ,
              BASIC_MATL                    Type  WRKST ,
              DOCUMENT                      Type  DZEINR  ,
              DOC_VERS                      Type  DZEIVR  ,
              PO_UNIT                       Type  BSTME ,
              PUR_GROUP                     Type  EKGRP ,
              AUTO_P_ORD                    Type  KAUTB ,
              "BATCH_MGMT Type  XCHPF ,
              PUR_VALKEY                    Type  EKWSL ,
              "GR_PR_TIME Type  WEBAZ ,
              COMM_CODE                     Type  STAWN ,
              COUNTRYORI                    Type  HERKL ,
              MRP_TYPE                      Type  DISMM ,
              REORDER_PT                    Type  MINBE ,
              MRP_CTRLER                    Type  DISPO ,
              LOTSIZEKEY                    Type  DISLS ,
              MINLOTSIZE                    Type  BSTMI ,
              MAXLOTSIZE                    Type  BSTMA ,
              FIXED_LOT                     Type  BSTFE ,
              MAX_STOCK                     Type  MABST ,
              ROUND_VAL                     Type  BSTRF ,
              PROC_TYPE                     Type  BESKZ ,
              SPPROCTYPE                    Type  SOBSL ,
              ISS_ST_LOC                    Type  LGPRO ,
              SLOC_EXPRC                    Type  LGFSB ,
              PLND_DELRY                    Type  PLIFZ ,
              GR_PR_TIME                    Type  WEBAZ ,
              SM_KEY                        Type  FHORI ,
              SAFETY_STK                    Type  EISBE ,
              PLNG_PLANT                    Type  PRWRK ,
              AVAILCHECK                    Type  MTVFP ,
              DEP_REQ_ID                    Type  SBDKZ ,
              ISSUE_UNIT                    Type  AUSME ,
              STGE_BIN                      Type  LGPBE ,
              BATCH_MGMT                    Type  XCHPF ,
              STGEPERIOD                    Type  MAXLZ ,
              STGE_PD_UN                    Type  LZEIH ,
              MINREMLIFE                    Type  MHDRZ ,
              SHELF_LIFE                    Type  MHDHB ,
              PERIOD_IND_EXPIRATION_DATE    Type  DATTP ,
              ROUND_UP_RULE_EXPIRATION_DATE Type  RDMHD ,
              STOR_PCT                      Type  MHDLP ,
              QM_AUTHGRP                    Type  QMATAUTH  ,
              QM_PROCMNT                    Type  QMPUR ,
              CTRL_KEY                      Type  SSQSS ,
    *           Type  ART ,
    *           Type  AKTIV ,
              VAL_CAT                       Type  BWTTY_D ,
              VAL_CLASS                     Type  BKLAS ,
              PRICE_CTRL                    Type  VPRSV ,
    * NEW ADDITION
              STD_PRICE                     Type  STPRS,
              PRICE_UNIT                    Type  PEINH ,
              MOVING_PR                     Type  VERPR ,
              QTY_STRUCT                    Type  CK_EKALREL  ,
              ORIG_GROUP                    Type  HRKFT ,
              ORIG_MAT                      Type  HKMAT ,
              VARIANCE_KEY                  Type  AWSLS ,
              PROFIT_CTR                    Type  PRCTR ,
              LANGU                         Type SPRAS,
           END OF t_master_data.
    *                  I N T E R N A L   T A B L E S
    DATA:
    *     Internal table of type t_master_data
          ist_master_data TYPE TABLE OF t_master_data,
    *     Internal table of type BAPIMATHEAD
          ist_headdata    TYPE TABLE OF BAPIMATHEAD,
    *     Internal table of type BAPI_MAKT
          ist_mat_desc    TYPE TABLE OF BAPI_MAKT,
    *     Internal table of type BAPI_MAKT
          ist_uom         TYPE TABLE OF BAPI_MARM,
    *     Internal table of type BAPI_MAKTX
          ist_uom_x       TYPE TABLE OF BAPI_MARMX.
    *                   G L O B A L   V A R I A B L E S
    DATA:
          it_num     TYPE num10,
    *     Global variable of type truxs_t_text_data
          it_raw     TYPE truxs_t_text_data.
    *                       W O R K   A R E A S
    DATA:
    *     Work area of type t_master_data
          wa_master_data                TYPE t_master_data,
    *     Work area of type bapimathead
          wa_bapimathead                TYPE BAPIMATHEAD,
    *     Work area of type bapi_mara
          wa_client_data                TYPE BAPI_MARA,
    *     Work area of type bapi_marax
          wa_client_data_x              TYPE  BAPI_MARAX,
    *     Work area of type bapi_marc
          wa_plant_data                 TYPE BAPI_MARC,
    *     Work area of type bapi_marcx
          wa_plant_data_x               TYPE BAPI_MARCX,
    *     Work area of type bapi_mard
          wa_storage_location_data      TYPE BAPI_MARD,
    *     Work area of type bapi_mardx
          wa_storage_location_data_x    TYPE BAPI_MARDX,
    *     Work area of type bapi_mbew
          wa_valuation_data             TYPE BAPI_MBEW,
    *     Work area of type bapi_mbewx
          wa_valuation_data_x           TYPE BAPI_MBEWX,
    *     Work area of type bapi_mard
          wa_mat_desc                   TYPE BAPI_MAKT,
    *     Work area of type bapi_marm
          wa_uom                        TYPE BAPI_MARM,
    *     Work area of type bapi_marmx
          wa_uom_x                      TYPE BAPI_MARMX,
    *     Work area of type mbapi_mpgd
          wa_planning_data              TYPE BAPI_MPGD,
    *     Work area of type mbapi_mpgdx
          wa_planning_data_x            TYPE BAPI_MPGDX,
    *     Work area of type mbapi_mpgd
          wa_return                     TYPE BAPIRET2.
    *                          P A R A M E T E R S
    PARAMETERS:
    *     Parameter of type rlgrap-filename
          p_file TYPE  rlgrap-filename.
    *               A T   S E L E C T I O N   S C R E E N
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          field_name = 'P_FILE'
        IMPORTING
          file_name  = p_file.
    *                S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
    * To upload data from flat file
      CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header        = 'X'
          i_tab_raw_data       = it_raw       " WORK TABLE
          i_filename           = p_file
        TABLES
          i_tab_converted_data = ist_master_data[]  "ACTUAL DATA
        EXCEPTIONS
          conversion_failed    = 1
          OTHERS               = 2.
      IF sy-subrc = 0.
        LOOP AT ist_master_data INTO wa_master_data.
          it_num = wa_master_data-PROFIT_CTR.
          wa_master_data-PROFIT_CTR = it_num.
          MOVE-CORRESPONDING wa_master_data to wa_bapimathead.
          MOVE-CORRESPONDING wa_master_data to wa_client_data.
          wa_client_data_x-MATL_GROUP = 'X'.
          wa_client_data_x-BASE_UOM = 'X'.
          wa_client_data_x-PO_UNIT = 'X'.
          wa_client_data_x-DOCUMENT = 'X'.
          wa_client_data_x-SIZE_DIM = 'X'.
          wa_client_data_x-BASIC_MATL = 'X'.
          wa_client_data_x-PUR_VALKEY = 'X'.
          wa_client_data_x-NET_WEIGHT = 'X'.
          wa_client_data_x-UNIT_OF_WT = 'X'.
          wa_client_data_x-DIVISION = 'X'.
          wa_client_data_x-BATCH_MGMT = 'X'.
          wa_client_data_x-QM_PROCMNT = 'X'.
          wa_client_data_x-MINREMLIFE = 'X'.
          wa_client_data_x-SHELF_LIFE = 'X'.
          wa_client_data_x-STOR_PCT = 'X'.
          wa_client_data_x-ROUND_UP_RULE_EXPIRATION_DATE = 'X'.
          wa_client_data_x-PERIOD_IND_EXPIRATION_DATE = 'X'.
          wa_client_data_x-ITEM_CAT = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_plant_data.
          wa_plant_data_x-PLANT  = wa_master_data-plant.
          wa_plant_data_x-PUR_GROUP = 'X'.
          wa_plant_data_x-ISSUE_UNIT = 'X'.
          wa_plant_data_x-MRP_TYPE = 'X'.
          wa_plant_data_x-MRP_CTRLER = 'X'.
          wa_plant_data_x-PLND_DELRY = 'X'.
          wa_plant_data_x-GR_PR_TIME = 'X'.
          wa_plant_data_x-LOTSIZEKEY = 'X'.
          wa_plant_data_x-PROC_TYPE = 'X'.
          wa_plant_data_x-SPPROCTYPE = 'X'.
          wa_plant_data_x-SAFETY_STK = 'X'.
          wa_plant_data_x-MINLOTSIZE = 'X'.
          wa_plant_data_x-MAXLOTSIZE = 'X'.
          wa_plant_data_x-FIXED_LOT = 'X'.
          wa_plant_data_x-ROUND_VAL = 'X'.
          wa_plant_data_x-MAX_STOCK = 'X'.
          wa_plant_data_x-DEP_REQ_ID = 'X'.
          wa_plant_data_x-SM_KEY = 'X'.
          wa_plant_data_x-STGEPERIOD = 'X'.
          wa_plant_data_x-STGE_PD_UN = 'X'.
          wa_plant_data_x-CTRL_KEY = 'X'.
          wa_plant_data_x-BATCH_MGMT = 'X'.
          wa_plant_data_x-AVAILCHECK = 'X'.
          wa_plant_data_x-AUTO_P_ORD = 'X'.
          wa_plant_data_x-COMM_CODE = 'X'.
          wa_plant_data_x-COUNTRYORI = 'X'.
          wa_plant_data_x-PROFIT_CTR = 'X'.
          wa_plant_data_x-ISS_ST_LOC = 'X'.
          wa_plant_data_x-VARIANCE_KEY = 'X'.
          wa_plant_data_x-SLOC_EXPRC = 'X'.
          wa_plant_data_x-QM_AUTHGRP = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_planning_data.
          wa_planning_data_x-PLANT = wa_master_data-plant.
          wa_planning_data_x-PLNG_PLANT = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_storage_location_data.
          wa_storage_location_data_X-PLANT = wa_master_data-plant.
          wa_storage_location_data_X-STGE_LOC = wa_master_data-stge_loc.
          wa_storage_location_data_X-STGE_BIN = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_valuation_data.
          wa_valuation_data-VAL_AREA = '1000'.
          wa_valuation_data_X-VAL_AREA = '1000'.
          wa_valuation_data_X-PRICE_CTRL = 'X'.
          wa_valuation_data_X-MOVING_PR  = 'X'.
          wa_valuation_data_X-PRICE_UNIT = 'X'.
          wa_valuation_data_X-STD_PRICE = 'X'.
          wa_valuation_data_X-VAL_CLASS = 'X'.
          wa_valuation_data_X-ORIG_GROUP = 'X'.
          wa_valuation_data_X-QTY_STRUCT = 'X'.
          wa_valuation_data_X-ORIG_MAT = 'X'.
          MOVE-CORRESPONDING wa_master_data to wa_mat_desc.
          APPEND wa_mat_desc to ist_mat_desc.
          IF wa_master_data-PRICE_CTRL = 'S' AND wa_master_data-STD_PRICE IS INITIAL.
            WRITE:/ 'Standard Price not maintained for material ',wa_master_data-MATERIAL.
          ELSE.
            CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
              EXPORTING
                HEADDATA             = wa_bapimathead
                CLIENTDATA           = wa_client_data
                CLIENTDATAX          = wa_client_data_x
                PLANTDATA            = wa_plant_data
                PLANTDATAX           = wa_plant_data_X
                PLANNINGDATA         = wa_planning_data
                PLANNINGDATAX        = wa_planning_data_x
                STORAGELOCATIONDATA  = wa_storage_location_data
                STORAGELOCATIONDATAX = wa_storage_location_data_x
                VALUATIONDATA        = wa_valuation_data
                VALUATIONDATAX       = wa_valuation_data_x
              IMPORTING
                RETURN               = wa_return
              TABLES
                MATERIALDESCRIPTION  = ist_mat_desc.
            Write:/ wa_return-message.
            CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
            Clear: wa_bapimathead
             ,wa_client_data
             ,wa_client_data_x
             ,wa_plant_data
            ,wa_plant_data_X
            ,wa_planning_data
             ,wa_planning_data_x
            ,wa_storage_location_data
             ,wa_storage_location_data_x
             ,wa_valuation_data
           ,wa_valuation_data_x.
          ENDIF.
          REFRESH ist_mat_desc.
        ENDLOOP.
      ELSE.
        Write:/ text-001.
      ENDIF.
    In the above code note how i have taken the same names for the fields in internal table as they are in the BAPI so that the mapping of data becomes easier, since i use MOVE CORRESPONDING.
    Regards,
    Shraddha
    Edited by: shraddha85 on Jan 31, 2011 9:49 AM

  • Bapi Function call from Crystal reports 2008. import parameters syntax.

    Dear,
    I have an issue with calling a function directly from Crystal reports (2008) in the R3 system.
    (if this belongs in another thread , please add the link if moved !)
    I try to get data through function "BAPI_CLASS_GET_CLASSIFICATIONS".
    Till now all possible input parameters have no data-result.
    I already read other threads stating that 'for example' the Language key needs to be provided in a single character. 'E' in stead of 'EN'.
    I also already created a Z-wrap-function that fills out all input parameters 'hardcoded'. This works.
    clearly there are som syntax changes in passing the values to R3 when called from Crystal Reports.
    Can someone state which syntax has to be followed for numeric fields, for datefields etc. (so when i make these dynamical, I know which syntax should be the outcome of the formula)
    in my function that doesn't work I use these selections:
    (this function is called in a standard report only calling this function)
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_ISO} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_LANGU_INT} = "E" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSNUM} = "DSWTEST" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_CLASSTYPE} = "001" and
    {BAPI_CLASS_GET_CLASSIFICATIONS_1.I_KEY_DATE} = Date (2011, 08, 05)
    I already tried other languages or the 'EN' as input.
    (I would like to know how the date is passed exaclty to R3.)
    The function is of course RFC enabled.
    when I call the my Z-function with predefined inputparameters in R3 it does give the wanted result.
    FUNCTION ZBAPI_CLASS_GET_CLASSIFICATION.
    ""Local Interface:
    *"  TABLES
    *"      OBJECT_CLASSIFICATION STRUCTURE  BAPI_OBJECT_VALUES
    *"      CLASS_OBJECTS STRUCTURE  BAPI_CLASS_OBJECTS
    data ZOBJECT_CLASSIFICATION type TABLE OF BAPI_OBJECT_VALUES.
    data ZCLASS_OBJECTS  type TABLE OF BAPI_CLASS_OBJECTS WITH HEADER LINE.
    ZCLASS_OBJECTS-OBJECT_KEY = '000000000000000085'.
    ZCLASS_OBJECTS-OBJECT_TYPE = 'MARA'.
    Append ZCLASS_OBJECTS.
    CALL FUNCTION 'BAPI_CLASS_GET_CLASSIFICATIONS'
      EXPORTING
        CLASSTYPE                    = '001'
        CLASSNUM                     = 'DSWTEST'
    *   KEY_DATE                     = SY-DATUM
    *   LANGU_ISO                    =
    *   LANGU_INT                    =
    *   CHARACTS_OF_CLASS_ONLY       =
    * IMPORTING
    *   RETURN                       =
      TABLES
        OBJECT_CLASSIFICATION        = ZOBJECT_CLASSIFICATION
        CLASS_OBJECTS                = ZCLASS_OBJECTS
    OBJECT_CLASSIFICATION[] = ZOBJECT_CLASSIFICATION[].
    ENDFUNCTION.
    please advise.
    once again if this should be moved to another forum , add the link please!

    Dear,
    I just debugged my Z-function, after adding all input parameters as in the standard BAPI function.
    All parameters seems to be passed correctly except from the table parameters from
    CLASS_OBJECTS
    So all I_parameters are passed :
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_INT} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_LANGU_ISO} = "EN" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_KEY_DATE} = Date (2011, 08, 05) and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSNUM} = "DSWTEST" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CLASSTYPE} = "001" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.I_CHARACTS_OF_CLASS_ONLY.BAPIFLAG} = ""
    but the table parameters aren't coming through:
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_TYPE} = "MARA" and
    {ZBAPI_CLASS_GET_CLASSIFICATION.T_CLASS_OBJECTS.OBJECT_KEY} = "000000000000000085" and
    these are 'blanco' in the function.
    also after the function is executed and all data is retrieved, when passing the data back to Crystal reports, once again, the table result isn't passed to Crystal Reports.
    please advise

  • Return parameters and error handling in bapi

    i am checking one codition. if that condition satisfies, to give a message i have to fill the return parameter.
    For this i have used the function module BALW_BAPIRETURN_GET2 and in this RETURN parameter is of structure BAPIRET2.
    But my requirement is, i want a function module to give messagewhich uses RETURN parameter of type BAPIRETURN1.
    could you please help me if u have any idea.

    Hi Keshav,
    yes, its a custom function module..
    i am sending the code
    FUNCTION zbapi_hr_record_time.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(EMPNO) LIKE  ZBAPIP9090-EMPNO
    *"     VALUE(EDATE) LIKE  ZBAPIP9090-EDATE
    *"     VALUE(NO_OF_HOURS) LIKE  ZBAPIP9090-NO_OF_HOURS
    *"     VALUE(COMMENTS) LIKE  ZBAPIP9090-COMMENTS
    *"     VALUE(EENDDA) LIKE  ZBAPIP9090-EENDDA DEFAULT SY-DATUM
    *"     VALUE(EBEGDA) LIKE  ZBAPIP9090-EBEGDA DEFAULT SY-DATUM
    *"  EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2
    DATA : p9090 LIKE p9090,
           opern LIKE psyst-ioper VALUE 'INS'.
    DATA : it_pa9090 LIKE pa9090 OCCURS 0 WITH HEADER LINE,
           wa_hours(2) TYPE c.
    SELECT no_of_hours FROM pa9090
                       INTO CORRESPONDING FIELDS OF TABLE it_pa9090
                       WHERE empno = empno
                       AND   edate = edate.
    CLEAR wa_hours.
    LOOP AT it_pa9090.
    wa_hours = wa_hours + it_pa9090-no_of_hours.
    ENDLOOP.
    wa_hours = wa_hours + no_of_hours.
    IF wa_hours GT 24.
    *CALL FUNCTION 'BALW_BAPIRETURN_GET2'
    *  EXPORTING
    *    type             = 'E'
    *    cl               = 'ZHR_TIME'
    *    number           = '000'
    **   PAR1             = ' '
    **   PAR2             = ' '
    **   PAR3             = ' '
    **   PAR4             = ' '
    **   LOG_NO           = ' '
    **   LOG_MSG_NO       = ' '
    **   PARAMETER        = ' '
    **   ROW              = 0
    **   FIELD            = ' '
    * IMPORTING
    *   return           = return
    ELSE.
    ENDIF.
    ENDFUNCTION.
    in the aboove code, after IF condition (IF wa_hours GT 24.) instead of using BALW_BAPIRETURN_GET2 function module i want an alternative function module to return message. here in BALW_BAPIRETURN_GET2, RETURN is declared as BAPIRET2,  but i want it as of BAPIRETURN1 structure. so could you please tell me if u know any other FM to RETURN message which uses BAPIRETURN1 structure.

  • Bapi to return a Sales order (RMA)

    Hi guys,
    I am trying to do a return using a sales order as reference. I am using:
    - BAPI_OUTB_DELIVERY_CREATE_SLS <<< to create a delivery
    - BAPI_TRANSACTION_COMMIT <<< to commit my changes
    - WS_DELIVERY_UPDATE <<< to PGI
    It doesn't produce any errors but when I go to MB52 the stock level does not change. I see in some posts that the correct bapi to post a return for a sales order is: BAPI_CUSTOMERRETURN_CREATE but i'm not sure which parameters i need to set for this bapi. Can you please help? Here's my code so far...
    *Create delivery
      CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_SLS'
        IMPORTING
          delivery          = delivery
          num_deliveries    = num_deliveries
        TABLES
          sales_order_items = sales_order_items
          serial_numbers    = serial_numbers
          deliveries        = deliveries
          created_items     = created_items
          extension_out     = extension_out
          return            = return.
    *Check for errors
      READ TABLE return INTO wa_return WITH KEY type = 'E'.
      IF sy-subrc EQ 0. "error found
        p_lv_err_flag = 'X'.
        LOOP AT return INTO wa_return WHERE type = 'E'.
          CONCATENATE wa_return-message p_lv_error_message INTO p_lv_error_message SEPARATED BY space.
        ENDLOOP.
        ROLLBACK WORK.
        RETURN.
      ELSE.             "no error found
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = return_commit.
        IF return_commit-type = 'S' OR return_commit-type IS INITIAL.
          READ TABLE return INTO wa_return WITH KEY type = 'S' id = 'VL'.
          IF sy-subrc = 0.
            p_lv_err_flag = 'S'.
            MOVE wa_return-message TO p_lv_error_message.
          ENDIF.
        ELSE.
          p_lv_err_flag = 'X'.
          MOVE return_commit-message TO p_lv_error_message.
        ENDIF.
      ENDIF.
    * Perform picking, confirmation W-M status and PGI.
      CLEAR: vbkok_wa, vbpok_tab.
      REFRESH: vbpok_tab.
    * Clearing the implicit lock that mb_create_goods_mvt has. That
    * prevents it from bieng called more then once within same LUW.
      PERFORM clear_xcommit IN PROGRAM saplmbwl.
      LOOP AT created_items INTO created_items_wa.
        vbkok_wa-vbeln_vl = created_items_wa-deliv_numb.
        vbkok_wa-vbtyp_vl = 'C'. "order
        vbkok_wa-vbeln = created_items_wa-deliv_numb.
        vbkok_wa-wabuc = 'T'. "returns delivery
        vbpok_wa-vbeln_vl = created_items_wa-deliv_numb.
        vbpok_wa-posnr_vl = created_items_wa-deliv_item.
        vbpok_wa-vbeln = created_items_wa-deliv_numb.
        vbpok_wa-posnn = created_items_wa-deliv_item.
        vbpok_wa-matnr = created_items_wa-material.
    *  vbpok_wa-charg = fp_afpo-charg. "batch number???
        READ TABLE p_lt_rma_be INTO ls_rma_be WITH KEY matnr = created_items_wa-material.
        vbpok_wa-werks = ls_rma_be-werks.
        vbpok_wa-taqui = 'X'.
        vbpok_wa-pikmg = created_items_wa-dlv_qty.
        APPEND vbpok_wa TO vbpok_tab.
      ENDLOOP.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
        EXPORTING
          vbkok_wa                 = vbkok_wa
          synchron                 = 'X'
          delivery                 = delivery_ws
          update_picking           = 'X'
          nicht_sperren            = 'X'
          if_database_update       = '1'
          if_error_messages_send_0 = 'X'
        TABLES
          vbpok_tab                = vbpok_tab
          prot                     = prot.
    * Checking if any error in PGI
      READ TABLE prot WITH KEY msgty = 'E' TRANSPORTING NO FIELDS.
      IF sy-subrc EQ 0.
        MESSAGE e046 WITH delivery_ws.
        ROLLBACK WORK.
        RETURN.
      ENDIF.
      READ TABLE prot WITH KEY msgty = 'A' TRANSPORTING NO FIELDS.
      IF sy-subrc EQ 0.
        MESSAGE e046 WITH delivery_ws.
        ROLLBACK WORK.
        RETURN.
      ENDIF.
      COMMIT WORK AND WAIT.

    I got past the previous error. I'm now getting the following error:
    External number assignment is not defined for document type ZRE
    Sales document 0000000018 was not changed
    Here's the code:
    *& Report  ZTEST_BAPI_RETURN_SALES_ORDER
    REPORT  ztest_bapi_return_sales_order.
    DATA: return_partners TYPE TABLE OF bapiparnr,
          wa_return_partners TYPE bapiparnr,
          return_header_in TYPE bapisdhd1,
          return_header_inx TYPE bapisdhd1x,
          return_items_in TYPE TABLE OF bapisditm,
          return_items_in_wa TYPE bapisditm,
          return_items_inx TYPE TABLE OF bapisditmx,
          return_schedules_in TYPE TABLE OF bapischdl,
          return_schedules_inx TYPE TABLE OF bapischdlx,
          return TYPE TABLE OF bapiret2,
          wa_return TYPE bapiret2,
          salesdocumentin TYPE bapivbeln-vbeln,
          salesdocument TYPE bapivbeln-vbeln.
    DATA: lv_knumv TYPE vbrk-knumv.
    DATA: i_konv LIKE konv OCCURS 0 WITH HEADER LINE,
          i_conditions TYPE TABLE OF bapicond WITH HEADER LINE.
    salesdocumentin = '0000000018'.
    SELECT SINGLE knumv FROM vbrk INTO lv_knumv WHERE vbeln = salesdocumentin.
    IF sy-subrc = 0.
      SELECT * FROM konv
      INTO TABLE i_konv
      WHERE knumv = lv_knumv
      AND kposn = '000010'
      AND kschl = 'ZRSK'.
    *  AND kschl = 'ZPR0'.
    *  AND kschl = 'ZRSK'.
    *  AND kschl = 'ZKF1'.
    *  AND kschl = 'CTXJ'.
    *  AND kschl = 'JRC1'.
    *  AND kschl = 'JRC2'.
    *  AND kschl = 'VPRS'.
      LOOP AT i_konv.
        i_conditions-itm_number = i_konv-kposn.
        i_conditions-cond_type = i_konv-kschl.
        i_conditions-cond_value = i_konv-kbetr.
        i_conditions-currency = i_konv-waers.
        i_conditions-cond_unit = i_konv-kmein.
        i_conditions-cond_p_unt = i_konv-kpein.
        i_conditions-numconvert = i_konv-kumza.
        i_conditions-denominato = i_konv-kumne.
        i_conditions-condorigin = i_konv-kherk.
        i_conditions-accountkey = i_konv-kvsl1.
        i_conditions-condcntrl = i_konv-ksteu.
        i_conditions-condclass = i_konv-koaid.
        i_conditions-condchaman = i_konv-kmprs.
        APPEND i_conditions.
      ENDLOOP.
    ENDIF.
    CLEAR: return_header_in, return_header_inx.
    return_header_in-price_date = sy-datum.
    return_header_in-ref_doc = '0000000018'.
    return_header_in-doc_type = 'ZRE'.
    return_header_in-sales_org = '1000'.
    return_header_in-distr_chan = '10'.
    return_header_in-division = '10'.
    return_header_in-sales_grp = '110'.
    return_header_in-sales_off = '100'.
    return_header_in-ship_cond = 'RE'.
    return_header_inx-ref_doc = 'X'.
    return_header_inx-doc_type = 'X'.
    return_header_inx-updateflag = 'I'.
    return_items_in_wa-itm_number = '000010'.
    return_items_in_wa-material = 'TACKER'.
    return_items_in_wa-target_qty = '1'.
    APPEND return_items_in_wa TO return_items_in.
    wa_return_partners-partn_role = 'AG'.
    wa_return_partners-partn_numb = '0000200111'.
    *wa_return_partners-itm_number = '000010'.
    APPEND wa_return_partners TO return_partners.
    CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'
      EXPORTING
        salesdocumentin               = salesdocumentin
        return_header_in              = return_header_in
        return_header_inx             = return_header_inx
      IMPORTING
        salesdocument                 = salesdocument
      TABLES
        return                        = return
        return_items_in               = return_items_in
        return_items_inx              = return_items_inx
        return_partners               = return_partners
        return_schedules_in           = return_schedules_in
        return_schedules_inx          = return_schedules_inx
        return_conditions_in          = i_conditions
    LOOP AT return INTO wa_return WHERE type = 'E'.
      WRITE:/ wa_return-message.
    ENDLOOP.

  • OO approach for bapi return

    HI ,
    I am using the FM BALW_BAPIRETURN_GET2 and i want to know if there OO approach that emulate
    this issue .
    Regards
    Joy
          CALL FUNCTION 'BALW_BAPIRETURN_GET2'
              EXPORTING
                type   = 'E'
                cl     = if_consnts=>gc_m_cl
                number = 25
                par1   = lv_msg
              IMPORTING
                return = ls_return.

    Joy,
    It really depends on what you're trying to achieve.
    In older releases I used a class similar to CL_RECA_MESSAGE_LIST that I built myself, to collect messages for logging purposes. I wouldn't call that an "OO approach" per se, although it uses OO.
    An important detail, however, that has nothing to do with OO: if you pass the message details (especially message class and number) to a method as literals, the where-used analysis on the message (from SE91) will not find this spot. So I found it useful to do more or less as follows:
    DATA l_msgtext TYPE string.
    MESSAGE ID if_consnts=>gc_m_cl TYPE 'E' NUMBER '25'
      WITH lv_msg
      INTO l_msgtext.
    CALL FUNCTION 'BALW_BAPIRETURN_GET2'
      EXPORTING
        type   = sy-msgty
        cl     = sy-msgid
        number = sy-msgno
        par1   = sy-msgv1
      IMPORTING
        return = ls_return.
    If you do it like this, the where-used analysis will find the spot. And if you replace the function BALW_BAPIRETURN_GET2 with something of your liking or you leave it as-is, that's up to you.
    Regards
    Rainer

Maybe you are looking for

  • HT1918 about selecting payment type in my payment information

    I am chooseing NONE of payment type and clicked done , but it says " contact itunes support to complete this transaction.Why??

  • What are the differences between MainStage 2 and MainStage 3?

    Hi everybody, I m running MainStage 2.2.2 and I am wondering what are the differences between the MainStage Version 2 vs MainStage 3. Is the recent one really more better than the 2?? Thanks a lot for answering regards, G.

  • LOB/CLOB Oracle 8i

    We need to store and manage more than 100 Powerpoint Presentations greater than 2meg each (up to 8meg)in Oracle, and were told that LOB/CLOB technology could help us do this. However, we are having problems even storing files 500K in size ! Can anyon

  • UDP Flood to Host when iPhone connected to WiFi

    Have been bothered with this issue for weeks now and finally decided to ask for help. Any suggestion is highly appreciated. When my iPhone (and my wife's) are connected to the home (WiFi) network, there's a seemingly random amount of UDP Flood to Hos

  • ERROR on drilldown : System error in program CL_RSDM_READ_MASTER_DATA...

    Hi Experts, I have 'Original Curr./Unit' 1CUDIM  as a free characteristic in my query. When I drilldown on this and then try to drilldown on any other free char, it gives the following error: 'System error in program CL_RSDM_READ_MASTER_DATA and form