MESSAGE_NOT_FOUND

Hi Guys,
In my file to proxy sync scenario, i am getting the following error.
Message_Not_Found
XML message not found.
when i look into RWB, in the Inbound Message, there is no payload available.
Is there anyway to check this?
Experts pls guide me.
Regards
Bala.

Hi Hemant,
Thanks for the response.
I have checked RWB, it is showing error "Canceled with Errors"
Even when i check in SXMB_MONI, there is no payload in the inbound message.
can you tell me is there any other way to check this?
Regards
Bala.

Similar Messages

  • BPM Scneario .. SOAP-XI-BW , Error: " MESSAGE_NOT_FOUND"

    Hi all,
    Webservice --> XI -->BW .
    BPM has been used to send the response back.
    BPM :
    start ->Receive(Request)> Transformation(Responsemap)>Send(SendtoBW)->Send(Send Response) ---> stop.
    The request message processed succesfully and sent to BW system. But we are facing the problem while sending the Response back to the Webservice. The response map is done correctly but it is showing error as below and the same message is going as SOAP response.
    <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="PERSIST">MESSAGE_NOT_FOUND</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>XML message not found</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    Kindly anyone please suggest what might be the problem.
    Thanks
    Deepthi

    >start ->Receive(Request)> Transformation(Responsemap)>Send(SendtoBW)->Send(Send Response) ---> stop.
    Your first query doesnt suit my explanation, since you are using a transformation step for sending converted message (as expected by BW system) from SOAP request. Of course this is valid. the only difference is I said to use mapping outside BPM.
    Send(Send Response):
    before this step there should be one more transformation step
    (performing a mapping the hardcoded values Status : OK
    Text : Succesfully Processed.
    to Webserive Response message structure).
    The webservice wont consider any other message structure apart from its original response message structure.
    So the flow will be like this,
    start ->Receive(Request) in Open S/A mode> Transformation1(Responsemap)>Send(SendtoBW)->Transformation2(for Mapping hardcoded message structure to WebService Response Message Structure) >Send(Send Webservice Response) in Closes S/A mode-> stop.
    Thanks,
    - Gujjeti.
    Edited by: Praveen Gujjeti on Feb 24, 2009 12:27 PM

  • Error MESSAGE_NOT_FOUND

    Hi Guys,
    We have a File to RFC synchronous scenario that used to work fine. However, currently we are getting the following error when uploading a file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="PERSIST">MESSAGE_NOT_FOUND</SAP:Code>
      <SAP:P1>(loc: WM9 ; TC: SXMSPERROR ; SM: 0 ; RR: 0 )</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>XML message not found</SAP:Stack>
      <SAP:Retry>N</SAP:Retry>
      </SAP:Error>
    What is weird is that the interface sometimes works and sometimes it doesn't. We get this error in the sender file adapter and the receiver RFC adapter doesn't get invoked.

    Hi ,
              Please kindly re-check the following
    1. Data type.
    2. Message type
    3.Message mapping: Update and activate
    4. Interface mapping.
    5. Activate the Interface mapping once again after updating it.
    6. Test the scenario from ID by suppying XML payload.
    7. Run an end to end testing once again.
    regards
    Anupam

  • Xi error MESSAGE_NOT_FOUND:

    Hi Iam using a File - RFC scenario (Async- Sync without BPM) through adapter modules.We are on PI 7.0 SP14.
    When the files are picked up in some cases Iam getting this error and the file is not archived...The RFC module is not called and XI throws error saying message not found.
    Error: com.sap.aii.af.service.util.transaction.api.TxManagerException: Unable to roll back transaction: com.sap.engine.services.ts.exceptions.BaseIllegalStateException
    10/24/08 1:23:11 PM e8231032-729a-4daa-260b-c5516d36b875 Error: com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:MESSAGE_NOT_FOUND:
    When I looked in Moni trace iam seeing an error saying message Id already exists..can any one tell me why this has happened??
    When I looked at the message monitoring in RWB iam seeing a single message with CAncelled with errors status updating again and again..(Even for new set of files)??
    any help is appreciated?
    Larry

    Hi
    I think there are too many messages getting into Q. As you are not using BPM may be it is generating same ID  for a message and RFC is throwing them as duplicates.
    You need to generate the files in sequence. I think EOIO should help you with this as it can help generated unique ID for messages in a Q.
    Check if you see anything in logs. If nothing check the LOGGING_SYNC is 1 or not in SXMB_ADM
    Thanks
    Gaurav

  • Error: Read timed out&MESSAGE_NOT_FOUND.

    Hi,
    There's a synchronous scenario (File-File). A connection failure occured during a query from buisness-process (BPM). Since then an error (error message) appears constantly in Runtime Workbench-Component Monitoring-Communication Channels.
    Success
    RRB: entering RequestResponseBean
    Success
    RRB: passing through ...
    Success
    RRB: suspending the transaction
    Success
    RRB: leaving RequestResponseBean
    Success
    Application attempting to send an XI message synchronously using connection File_http://sap.com/xi/XI/System.
    Success
    Trying to put the message into the call queue.
    Success
    Message successfully put into the queue.
    Success
    The message was successfully retrieved from the call queue.
    Success
    The message status set to DLNG.
    Error
    Received XI System Error. ErrorCode: GENERAL ErrorText: com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out ErrorStack: 
    Error
    Returning synchronous error notification to calling application: com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out.
    Error
    Transmitting the message using connection http://*****:8010/sap/xi/engine?type=entry failed, due to: com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out.
    Error
    The message status set to FAIL.
    Error
    Returning to application. Exception: com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out
    Error
    Attempt to process file failed with com.sap.aii.af.ra.ms.api.DeliveryException: XIAdapterFramework:GENERAL:com.sap.aii.af.ra.ms.api.DeliveryException: Read timed out
    Error
    Attempt to process file failed with com.sap.aii.af.service.util.transaction.api.TxManagerException: Unable to roll back transaction: com.sap.engine.services.ts.exceptions.BaseIllegalStateException
    File removing and the channel rebooting the channel donu2019t help.
    After rebooting the channel:
    Error
      Received XI System Error. ErrorCode: MESSAGE_NOT_FOUND ErrorText:   ErrorStack: XML message not found
    Error
      Returning synchronous error notification to calling application: com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:MESSAGE_NOT_FOUND:.
    Error
      Transmitting the message using connection http://*****:8010/sap/xi/engine?type=entry failed, due to: com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:MESSAGE_NOT_FOUND:.
    Error
      The message status set to FAIL.
    Error
      Returning to application. Exception: com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:MESSAGE_NOT_FOUND:
    Error
      Attempt to process file failed with com.sap.aii.af.ra.ms.api.DeliveryException: XIServer:MESSAGE_NOT_FOUND:
    Error
      Attempt to process file failed with com.sap.aii.af.service.util.transaction.api.TxManagerException: Unable to roll back transaction: com.sap.engine.services.ts.exceptions.BaseIllegalStateException
    Any ideas?

    hi,
    try this,
    go to Message Monitoring in RWB, delete all the messages with status system error and onhold.
    it shd solve your problem
    Regards,
    Sukarna.chirumamilla.

  • Selection Criteria addition-Not working

    Hi!
    I have this report wherein I need to add two fields VBAP-Kunnr and knvv-konda in the selection screen so that I can do my drill down or search criteria based upon these two selections also apart from the existing ones, but unfortunately I am unable to get throiugh this and somehow putting this two selections in the selection criteria its not taking any effect or its just actinga  dummy selection and I am unale to drill down my report based upon those. Can anyone have a look and let me know what could be the problem please. Help would be highly appreciated.
    Thanks
    *& Include ZSD_PFGENERATETOP Report ZSD_PFGENERATE
    REPORT zsd_pfgenerate LINE-SIZE 170 LINE-COUNT 65.
    TABLES: lips, likp, vbap, vbak, vbrp, vbpa, vbrk.
    CONSTANTS: cns_vgtyp TYPE vbrp-vgtyp VALUE 'J',
    cns_intyp TYPE vbrk-vbtyp VALUE 'M',
    cns_vkorg TYPE vbak-vkorg VALUE 'CA01',
    cns_vkorg_US type vbak-vkorg value 'US01', "DEVK903521
    cns_parsh TYPE vbpa-parvw VALUE 'WE',
    cns_parsp TYPE vbpa-parvw VALUE 'AG',
    cns_parre type vbpa-parvw value 'RE', "bill-to
    cns_auzwp TYPE vbak-auart VALUE 'ZWP',
    cns_auzct TYPE vbak-auart VALUE 'ZCT',
    cns_auzif TYPE vbak-auart VALUE 'ZIF',
    cns_auztm TYPE vbak-auart VALUE 'ZTM',
    cns_fkff TYPE vbrk-fkart VALUE 'ZFF5',
    cns_fkos TYPE vbrk-fkart VALUE 'ZOF5',
    cns_upd(1) TYPE c VALUE 'S',
    cns_mode(1) TYPE c VALUE 'N'.
    Internal Tables and Work Areas
    DATA: BEGIN OF it_vbpos OCCURS 0,
    werks TYPE vbap-werks,
    audat TYPE vbak-audat,
    auart TYPE vbak-auart,
    kunag TYPE vbak-kunnr,
    name1_ag TYPE kna1-name1,
    kunsh TYPE likp-kunnr,
    name1_sh TYPE kna1-name1,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    vbdel TYPE likp-vbeln,
    psdel TYPE lips-posnr,
    kunre type kunre, "Bill-to Party
    name1_re type kna1-name1, "Bill-to Party Name
    END OF it_vbpos,
    BEGIN OF it_vbpos_temp OCCURS 0,
    vgbel TYPE lips-vgbel,
    vgpos TYPE lips-vgpos,
    vbeln TYPE vbak-vbeln,
    posnr TYPE vbap-posnr,
    END OF it_vbpos_temp,
    BEGIN OF it_report OCCURS 0,
    werks TYPE vbap-werks,
    vbeln TYPE vbak-vbeln,
    vbdel TYPE likp-vbeln,
    audat TYPE vbak-audat,
    auart TYPE vbak-auart,
    name1_ag TYPE kna1-name1,
    name1_sh TYPE kna1-name1,
    name1_re type kna1-name1, "Bill-to Party Name
    mark(1) TYPE c,
    END OF it_report,
    BEGIN OF it_vbeln OCCURS 0,
    vbeln TYPE vbak-vbeln,
    END OF it_vbeln,
    wa_vbeln LIKE LINE OF it_vbeln,
    wa_vbpos LIKE LINE OF it_vbpos,
    wa_report LIKE LINE OF it_report,
    wa_sel LIKE LINE OF it_report.
    DATA: it_vbrp type table of vbrp,
    it_vbrk type table of vbrk.
    BDC Variables
    DATA: BEGIN OF bdc_tab OCCURS 0.
    INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.
    DATA: wa_bdc LIKE LINE OF bdc_tab,
    it_bdcmess TYPE TABLE OF bdcmsgcoll.
    *& Selection-Screen definition
    SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-002.
    PARAMETERS: p_rdff TYPE c RADIOBUTTON GROUP rad1 DEFAULT 'X',
    p_rdos TYPE c RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN END OF BLOCK block2.
    SELECTION-SCREEN BEGIN OF BLOCK block0 WITH FRAME TITLE text-000.
    SELECT-OPTIONS: s_werks FOR vbap-werks OBLIGATORY NO INTERVALS,
    s_auart FOR vbak-auart,
    s_kunag FOR vbak-kunnr, "Sold-to Party
    s_kunnr FOR likp-kunnr, "Ship-to Party
    s_kunre for vbak-kunnr, "Bill to Party
    s_vdatu FOR vbak-vdatu OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK block0.
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-001.
    PARAMETERS: p_vgbel TYPE vbak-vgbel.
    SELECTION-SCREEN END OF BLOCK block1.
    selection-screen begin of block block3 with frame title text-003.
    parameters: p_billed RADIOBUTTON GROUP r1,
    p_delvd RADIOBUTTON GROUP r1 default 'X',
    p_all RADIOBUTTON GROUP r1.
    selection-screen end of block block3.
    *& Include ZSD_PFGENERATEE01
    START-OF-SELECTION.
    PERFORM read_report.
    END-OF-SELECTION.
    SET PF-STATUS 'STAT1000'.
    IF it_vbpos[] IS INITIAL.
    MESSAGE s999(z001) WITH 'No Data Selected for this criteria'.
    ELSE.
    PERFORM show_report.
    ENDIF.
    *& List Events
    AT USER-COMMAND.
    CASE sy-ucomm.
    WHEN 'SELE'.
    LOOP AT it_report INTO wa_report.
    wa_report-mark = 'X'.
    MODIFY it_report FROM wa_report.
    ENDLOOP.
    PERFORM show_report.
    WHEN 'DSEL'.
    LOOP AT it_report INTO wa_report.
    wa_report-mark = ''.
    MODIFY it_report FROM wa_report.
    ENDLOOP.
    PERFORM show_report.
    ENDCASE.
    AT LINE-SELECTION.
    DO.
    READ LINE sy-index FIELD VALUE wa_report-mark wa_report-vbeln
    wa_report-vbdel.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = wa_report-vbeln
    IMPORTING
    output = wa_report-vbeln.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = wa_report-vbdel
    IMPORTING
    output = wa_report-vbdel.
    READ TABLE it_report INTO wa_sel
    WITH KEY vbeln = wa_report-vbeln.
    IF sy-subrc EQ 0.
    wa_sel-mark = wa_report-mark.
    MODIFY it_report FROM wa_sel INDEX sy-tabix.
    ENDIF.
    ENDIF.
    ENDDO.
    REFRESH: it_vbeln.
    LOOP AT it_report INTO wa_report WHERE mark EQ 'X'.
    CASE 'X'.
    WHEN p_rdff.
    wa_vbeln = wa_report-vbdel.
    WHEN p_rdos.
    wa_vbeln = wa_report-vbeln.
    ENDCASE.
    APPEND wa_vbeln TO it_vbeln.
    ENDLOOP.
    SORT it_vbeln BY vbeln.
    DELETE ADJACENT DUPLICATES FROM it_vbeln.
    IF NOT it_vbeln[] IS INITIAL.
    PERFORM process_vf01.
    ENDIF.
    *& Include ZSD_PFGENERATEF01
    *& Form read_report
    Routine to read applicable orders from database
    FORM read_report.
    DATA: lwa_lips TYPE lips,
    lc_vbeln TYPE vbrk-vbeln.
    Retrieve sales orders based on selection criteria where billing doc has not been
    created for the delivery yet
    REFRESH: it_vbeln, it_vbpos, it_report.
    Select into table based on Onsite/Fixed Facility
    CASE 'X'.
    WHEN p_rdff.
    changed for performance reasons (i.e. time-out)
    k~vgbel is not in it_vbpos but was in select statment ?
    SELECT vbap~werks vbak~audat vbak~auart vbak~kunnr AS kunag
    vbak~vbeln vbap~posnr
    INTO CORRESPONDING FIELDS OF TABLE it_vbpos
    FROM vbak INNER JOIN vbap
    ON vbak~mandt = vbap~mandt
    AND vbak~vbeln = vbap~vbeln
    WHERE vbap~werks IN s_werks
    AND vbak~vdatu IN s_vdatu
    AND vbak~vkorg in (cns_vkorg,cns_vkorg_US)
    AND vbap~oid_ship IN s_kunnr
    AND vbak~kunnr IN s_kunag
    AND vbak~auart IN s_auart
    AND ( vbak~auart = 'ZWP' or vbak~auart = 'ZIF' or
    vbak~auart = 'ZCT' or vbak~auart = 'ZTM' or
    vbak~auart = 'ZOIL' ).
    IF SY-SUBRC = 0.
    SELECT vgbel vgpos vbeln posnr FROM lips
    INTO CORRESPONDING FIELDS OF TABLE it_vbpos_temp
    FOR ALL ENTRIES IN it_vbpos
    WHERE vgbel = it_vbpos-vbeln
    AND vgpos = it_vbpos-posnr
    %_hints oracle 'index ("LIPS" "LIPS~Z01")'.
    SORT it_vbpos_temp by vgbel vgpos.
    LOOP AT it_vbpos.
    READ TABLE it_vbpos_temp
    WITH KEY vgbel = it_vbpos-vbeln vgpos = it_vbpos-posnr
    BINARY SEARCH.
    IF SY-SUBRC = 0.
    it_vbpos-vbdel = it_vbpos_temp-vbeln.
    it_vbpos-psdel = it_vbpos_temp-posnr.
    modify it_vbpos.
    ENDIF.
    ENDLOOP.
    ENDIF.
    WHEN p_rdos.
    SELECT k~vbeln p~posnr k~kunnr AS kunag k~audat k~auart p~werks k~vgbel
    INTO CORRESPONDING FIELDS OF TABLE it_vbpos
    FROM vbak AS k INNER JOIN vbap AS p ON k~vbeln = p~vbeln
    WHERE p~werks IN s_werks AND k~vdatu IN s_vdatu AND
    k~vkorg in (cns_vkorg,cns_vkorg_US) AND "DEVK903521
    k~vgbel EQ p_vgbel AND
    k~kunnr IN s_kunag AND k~auart IN s_auart AND
    p~oid_ship IN s_kunnr.
    ENDCASE.
    Determine if delivery has been billed out, if not can create PF Invoice - CHANGED
    LOOP AT it_vbpos INTO wa_vbpos.
    Check Ship-to in
    SELECT SINGLE kunnr INTO wa_vbpos-kunsh FROM vbpa
    WHERE parvw EQ cns_parsh AND vbeln EQ wa_vbpos-vbeln.
    IF sy-subrc NE 0.
    DELETE TABLE it_vbpos FROM wa_vbpos.
    CONTINUE.
    ENDIF.
    Check for Bill-to
    select single kunnr into wa_vbpos-kunre from vbpa
    where parvw eq cns_parre and vbeln eq wa_vbpos-vbeln
    and kunnr in s_kunre.
    IF sy-subrc NE 0.
    DELETE TABLE it_vbpos FROM wa_vbpos.
    CONTINUE.
    ENDIF.
    Get Partner Texts
    SELECT SINGLE name1 INTO wa_vbpos-name1_ag FROM kna1
    WHERE kunnr EQ wa_vbpos-kunag.
    SELECT SINGLE name1 INTO wa_vbpos-name1_sh FROM kna1
    WHERE kunnr EQ wa_vbpos-kunsh.
    SELECT SINGLE name1 INTO wa_vbpos-name1_re FROM kna1
    WHERE kunnr EQ wa_vbpos-kunre.
    CASE 'X'.
    WHEN p_rdff.
    IF p_delvd = 'X'.
    optimized for performance reasons i.e. time-out
    Check if delivery has been billed out
    SELECT SINGLE k~vbeln INTO lc_vbeln
    FROM vbrp AS p INNER JOIN vbrk AS k ON p~vbeln = k~vbeln
    WHERE p~vgtyp EQ cns_vgtyp AND p~vgbel EQ wa_vbpos-vbdel AND
    p~vgpos EQ wa_vbpos-psdel AND k~vbtyp EQ cns_intyp AND
    k~fksto NE 'X'.
    refresh: it_vbrp, it_vbrk.
    select vbeln from vbrp
    into corresponding fields of table it_vbrp
    where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
    and vgpos = wa_vbpos-psdel
    %_hints oracle 'index ("VBRP" "VBRP~Z01")'.
    if sy-subrc = 0.
    sort it_vbrp by vbeln.
    delete adjacent duplicates from it_vbrp comparing vbeln.
    select vbeln from vbrk
    into corresponding fields of table it_vbrk
    for all entries in it_vbrp
    where vbeln = it_vbrp-vbeln
    and vbtyp = cns_intyp and fksto 'X'.
    IF sy-subrc EQ 0.
    DELETE TABLE it_vbpos FROM wa_vbpos.
    CONTINUE.
    ENDIF.
    endif.
    ELSEIF p_billed = 'X'.
    Check if delivery hasn't been billed out
    SELECT SINGLE k~vbeln INTO lc_vbeln
    FROM vbrp AS p INNER JOIN vbrk AS k ON p~vbeln = k~vbeln
    WHERE p~vgtyp EQ cns_vgtyp AND p~vgbel EQ wa_vbpos-vbdel AND
    p~vgpos EQ wa_vbpos-psdel AND k~vbtyp EQ cns_intyp AND
    k~fksto NE 'X'.
    refresh: it_vbrp, it_vbrk.
    select vbeln from vbrp
    into corresponding fields of table it_vbrp
    where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
    and vgpos = wa_vbpos-psdel
    %_hints oracle 'index ("VBRP" "VBRP~Z01")'.
    if sy-subrc = 0.
    sort it_vbrp by vbeln.
    delete adjacent duplicates from it_vbrp comparing vbeln.
    select vbeln from vbrk
    into corresponding fields of table it_vbrk
    for all entries in it_vbrp
    where vbeln = it_vbrp-vbeln
    and vbtyp = cns_intyp and fksto 'X'.
    IF sy-subrc NE 0.
    DELETE TABLE it_vbpos FROM wa_vbpos.
    CONTINUE.
    ENDIF.
    endif.
    ENDIF.
    WHEN p_rdos.
    IF p_delvd = 'X'.
    Check if order has been billed out
    SELECT SINGLE * FROM vbrp
    WHERE vbeln EQ wa_vbpos-vbeln AND
    vgpos EQ wa_vbpos-posnr.
    IF sy-subrc EQ 0.
    DELETE TABLE it_vbpos FROM wa_vbpos.
    CONTINUE.
    ENDIF.
    ELSEIF p_billed = 'X'.
    Check if delivery hasn't been billed out
    SELECT SINGLE k~vbeln INTO lc_vbeln
    FROM vbrp AS p INNER JOIN vbrk AS k ON pvbeln = kvbeln
    WHERE pvgtyp EQ cns_vgtyp AND pvgbel EQ wa_vbpos-vbdel AND
    pvgpos EQ wa_vbpos-psdel AND kvbtyp EQ cns_intyp AND
    k~fksto NE 'X'.
    refresh: it_vbrp, it_vbrk.
    select vbeln from vbrp
    into corresponding fields of table it_vbrp
    where vgtyp = cns_vgtyp and vgbel = wa_vbpos-vbdel
    and vgpos = wa_vbpos-psdel
    %_hints oracle 'index ("VBRP" "VBRP~Z01")'.
    if sy-subrc = 0.
    sort it_vbrp by vbeln.
    delete adjacent duplicates from it_vbrp comparing vbeln.
    select vbeln from vbrk
    into corresponding fields of table it_vbrk
    for all entries in it_vbrp
    where vbeln = it_vbrp-vbeln
    and vbtyp = cns_intyp and fksto 'X'.
    IF sy-subrc NE 0.
    DELETE TABLE it_vbpos FROM wa_vbpos.
    CONTINUE.
    ENDIF.
    endif.
    ENDIF.
    ENDCASE.
    MOVE-CORRESPONDING wa_vbpos TO wa_report.
    APPEND wa_report TO it_report.
    MODIFY it_vbpos FROM wa_vbpos.
    ENDLOOP.
    if 'onsite field summary', then process by release sales orders
    IF p_rdos = 'X'.
    sort it_report by vbeln.
    delete adjacent duplicates from it_report comparing vbeln.
    else.
    SORT it_report BY werks name1_ag name1_sh vbeln.
    DELETE ADJACENT DUPLICATES FROM it_report.
    endif.
    SORT it_report BY name1_sh werks name1_ag vbeln.
    ENDFORM. " read_report
    *& Form process_vf01
    Call transaction VF01 and fill screen table with order values
    FORM process_vf01.
    DATA: ln_index(2) TYPE n,
    lc_field(20) TYPE c,
    lc_fkart TYPE vbrk-fkart,
    li_lines TYPE i,
    lc_msgtxt(99) TYPE c,
    lwa_bdcoptions TYPE ctu_params,
    lwa_mess LIKE LINE OF it_bdcmess.
    REFRESH: it_bdcmess.
    lwa_bdcoptions-dismode = cns_mode.
    lwa_bdcoptions-updmode = cns_upd.
    CASE 'X'.
    WHEN p_rdff.
    lc_fkart = cns_fkff.
    WHEN p_rdos.
    lc_fkart = cns_fkos.
    ENDCASE.
    REFRESH: bdc_tab.
    PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
    ' ' 'BDC_CURSOR' 'RV60A-FKART',
    ' ' 'RV60A-FKART' lc_fkart,
    ' ' 'BDC_OKCODE' '/00'.
    LOOP AT it_vbeln INTO wa_vbeln.
    ln_index = sy-tabix.
    Up to the second delivery of the BDC add the Delivery to the screen, after that click the More Documents for every entry. logic changed for DEVK902353
    CASE ln_index.
    WHEN 1.
    CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
    PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
    WHEN 2 OR 3.
    IF p_rdos 'X'.
    CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
    PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
    'X' 'SAPMV60A' '0102',
    ' ' 'BDC_OKCODE' 'FKAN'..
    ELSE.
    CONCATENATE 'KOMFK-VBELN' '(' ln_index ')' INTO lc_field.
    PERFORM update_bdc USING: ' ' lc_field wa_vbeln.
    ENDIF.
    WHEN OTHERS.
    If p_rdos 'X'.
    CONCATENATE 'KOMFK-VBELN' '(2)' INTO lc_field.
    PERFORM update_bdc USING: ' ' lc_field wa_vbeln,
    'X' 'SAPMV60A' '0102',
    ' ' 'BDC_OKCODE' 'FKAN'.
    endif.
    ENDCASE.
    ENDLOOP.
    VF01 will go to a different screen if only one line selected
    DESCRIBE TABLE it_vbeln LINES li_lines.
    IF li_lines EQ 1.
    PERFORM update_bdc USING: 'X' 'SAPMV60A' '0104',
    ' ' 'BDC_OKCODE' '=SICH'.
    ELSE.
    PERFORM update_bdc USING: 'X' 'SAPMV60A' '0102',
    ' ' 'BDC_OKCODE' '=SICH'.
    ENDIF.
    CALL TRANSACTION 'VF01' USING bdc_tab OPTIONS FROM lwa_bdcoptions
    MESSAGES INTO it_bdcmess.
    WRITE: / 'BDC Messages:'.
    SKIP.
    LOOP AT it_bdcmess INTO lwa_mess.
    CALL FUNCTION 'RH_MESSAGE_GET'
    EXPORTING
    arbgb = 'VF'
    msgnr = lwa_mess-msgnr
    msgv1 = lwa_mess-msgv1
    msgv2 = lwa_mess-msgv2
    msgv3 = lwa_mess-msgv3
    msgv4 = lwa_mess-msgv4
    IMPORTING
    msgtext = lc_msgtxt
    EXCEPTIONS
    message_not_found = 1
    OTHERS = 2.
    WRITE: /5 lc_msgtxt.
    ENDLOOP.
    ENDFORM. " process_vf01
    form update_bdc *
    subroutine to add the data to the bdc table for trans. vf01 *
    FORM update_bdc USING dynpro field content.
    CLEAR bdc_tab.
    IF dynpro EQ 'X'.
    bdc_tab-program = field.
    bdc_tab-dynpro = content.
    bdc_tab-dynbegin = 'X'.
    ELSE.
    bdc_tab-fnam = field.
    bdc_tab-fval = content.
    ENDIF.
    APPEND bdc_tab.
    ENDFORM. "UPDATE_BDC
    *& Form show_report
    Report to Display Available Orders on Screen
    FORM show_report .
    DATA: l_idx TYPE i.
    WRITE: / 'Available Orders/Deliveries for Plant:'.
    LOOP AT s_werks.
    WRITE: s_werks-low.
    ENDLOOP.
    SKIP.
    FORMAT INTENSIFIED ON COLOR COL_HEADING.
    WRITE: /5 text-h01, text-h02.
    CASE 'X'.
    WHEN p_rdff.
    WRITE: text-h06.
    ENDCASE.
    WRITE: text-h03, text-h04, text-h05, text-h07,
    / sy-uline.
    FORMAT INTENSIFIED OFF COLOR OFF.
    l_idx = 0.
    LOOP AT it_report INTO wa_report.
    IF l_idx EQ 0.
    FORMAT COLOR COL_NORMAL INTENSIFIED ON.
    l_idx = 1.
    ELSE.
    FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
    l_idx = 0.
    ENDIF.
    WRITE: / wa_report-mark AS CHECKBOX,
    wa_report-auart UNDER text-h01,
    wa_report-vbeln UNDER text-h02.
    CASE 'X'.
    WHEN p_rdff.
    WRITE: wa_report-vbdel UNDER text-h06.
    ENDCASE.
    WRITE: wa_report-audat UNDER text-h03,
    wa_report-name1_ag UNDER text-h04,
    wa_report-name1_sh UNDER text-h05,
    wa_report-name1_re under text-h07.
    HIDE: wa_report-mark, wa_report-vbeln, wa_report-vbdel.
    ENDLOOP.
    ENDFORM. " show_report
    Thanks for your kind help.
    Aarav.

    Hi, Anne-Marie;
    You may be running into a common issue that is docuemented here:
    [SelectionFormula|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303334333833393335%7D.do]
    Regards,
    Jonathan
    Edited by: Jonathan Parminter on Mar 16, 2009 8:03 AM

  • Error in Proportional Factor Calculation Program

    Hi ,
    I have developed an ABAP Program to calculate Proportional Factor(PF) as below.
    Generally,to calculate the PF for a period , we need to use transaction /sapapo/sdp94 to create a profile .After doing that , to calculate PF we need to go transaction /sapapo/mv8v .
    Now,the given program has three options :-
    1)Create : To create the selection-ID by taking ‘areabasepackRS’ as name of the selection-ID . Here we need to give the excel sheet that is used to load data into /sapapo/mc8v to calculate PF.
    2)Calculate PF : This option is used to calculate proportional factor.
       Now if we try to calculate PF ,I get an error message saying there are no
       plannable characteristic combinations .
    3) Delete : This option is used to delete the selection profile.
    I am getting an error in this program which I have explained with the document attached in this mail .
    Please could anyone help me out with this .
    The program is as below:-
    <b>report ZRSNORMS_PPF
           no standard page heading line-size 255.</b>
    *include bdcrecx1.
    INCLUDE ZAPO_DATA_DECLARATION_PPF.
    INCLUDE Z_APO_FORMS_PPF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
         program_name        = syst-repid
      DYNPRO_NUMBER       = SYST-DYNNR
         field_name          = p_file1
      STATIC              = ' '
      MASK                = ' '
        CHANGING
          file_name           = p_file1
    EXCEPTIONS
      MASK_TOO_LONG       = 1
      OTHERS              = 2
      IF sy-subrc <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    start-of-selection.
      PERFORM READ_DATA TABLES I_PROFILE
                               I_EXEL
                               IT_PROFILE_NAME
                        USING P_FILE1
                        CHANGING W_SUBRC.
      PERFORM SAVE_SELECTION TABLES I_EXEL
                                    IT_SAVE_SEL
                                    IT_PROFILE_NAME.
      IT_GRP-OBJNAM = 'ZRSBASPCK'.
      APPEND IT_GRP.
      LOOP AT IT_GRP INTO W_GROUP.
        APPEND W_GROUP TO IT_GROUP.
      ENDLOOP.
      G_PAREAID = 'ZRSPAHPC'.
      G_MVIEW = 'ZRSPAHPC'.
      G_COUNT = 0.
    IF CREATE = 'X'.
      LOOP AT IT_SAVE_SEL INTO W_SEL_SAVE.
        IF W_SEL_SAVE-IOBJNM = '9AVERSION' AND SY-TABIX > 1.
          G_COUNT = G_COUNT + 1.
          READ TABLE IT_PROFILE_NAME INDEX G_COUNT.
          G_NAME = IT_PROFILE_NAME-F_NAME.
          CALL FUNCTION '/SAPAPO/MCPSH_SELECTION_SAVE'
            EXPORTING
      IV_SELID                       =
      IV_FLG_USED_FOR                =
              IV_PAREAID                     = G_PAREAID
             IV_MVIEW                       =  G_MVIEW
             IV_SEL_DESCRIPTION             = G_NAME
             IT_SELECTION                   = IT_SEL_SAVE
      IT_OBJECTS                     =
             IT_SEL_GROUP                   = IT_GROUP
      IV_POPUP_SEL_DESCRIPTION       =
    IMPORTING
      EV_SELID                       =
      EV_SEL_DESCRIPTION             =
    EXCEPTIONS
      DUPLICATE_SELECTION            = 1
      MULTIPLE_SELECTION             = 2
      INCONSISTENT_DATABASE          = 3
      DUPLICATE_DESCRIPTION          = 4
      INVALID_DESCRIPTION            = 5
      NO_PERMISSION                  = 6
      SELID_INVALID                  = 7
      OTHERS                         = 8
          IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CLEAR IT_SEL_SAVE[].
          APPEND W_SEL_SAVE TO IT_SEL_SAVE.
        ELSEIF W_SEL_SAVE-IOBJNM = '9AVERSION' AND SY-TABIX = 1.
          APPEND W_SEL_SAVE TO IT_SEL_SAVE.
        ELSE.
          APPEND W_SEL_SAVE TO IT_SEL_SAVE.
        ENDIF.
      ENDLOOP.
      G_COUNT = G_COUNT + 1.
      READ TABLE IT_PROFILE_NAME INDEX G_COUNT.
      G_NAME = IT_PROFILE_NAME-F_NAME.
      CALL FUNCTION '/SAPAPO/MCPSH_SELECTION_SAVE'
        EXPORTING
      IV_SELID                       =
      IV_FLG_USED_FOR                =
          IV_PAREAID                     = G_PAREAID
         IV_MVIEW                       =  G_MVIEW
         IV_SEL_DESCRIPTION             = G_NAME
         IT_SELECTION                   = IT_SEL_SAVE
      IT_OBJECTS                     =
         IT_SEL_GROUP                   = IT_GROUP
      IV_POPUP_SEL_DESCRIPTION       =
    IMPORTING
      EV_SELID                       =
      EV_SEL_DESCRIPTION             =
    EXCEPTIONS
      DUPLICATE_SELECTION            = 1
      MULTIPLE_SELECTION             = 2
      INCONSISTENT_DATABASE          = 3
      DUPLICATE_DESCRIPTION          = 4
      INVALID_DESCRIPTION            = 5
      NO_PERMISSION                  = 6
      SELID_INVALID                  = 7
      OTHERS                         = 8
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      IV_GROUP = 'ZRSBASPCK'.
      LOOP AT IT_SEL_SAVE INTO w_confirm_sel.
        APPEND w_confirm_sel TO it_confirm_sel.
      ENDLOOP.
      CALL FUNCTION '/SAPAPO/MSDP_SH_OBJ_LIST_BUILD'
        EXPORTING
          IV_PAREAID           = G_PAREAID
         IV_MVIEW             = G_MVIEW
        IV_DVIEW             =
        IV_FROMDATE          =
        IV_ENDDATE           =
        IV_NO_POPUPS         =
      IMPORTING
        ET_SH_OBJECTS        =
      EXCEPTIONS
        INVALID_INPUT        = 1
        INTERNAL_ERROR       = 2
        OTHERS               = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CLEAR IT_SEL_SAVE[].
    ENDIF.
    if calc_ppf = 'X'.
      PERFORM CALC_PPF TABLES I_EXEL
                              BDCTAB
                              IT_PROFILE_NAME.
    ENDIF.
    if del_prof = 'X'.
    LOOP AT I_EXEL.
    concatenate i_exel-area I_EXEL-BASE INTO DEL_NAME.
    SELECT SINGLE * FROM /SAPAPO/TS_SELKO INTO IT_TS_SELKO
    WHERE SEL_DESRCIPTION = DEL_NAME.
    DEL_PROFILE = IT_TS_SELKO-SELECTIONID.
    CALL FUNCTION '/SAPAPO/MCPSH_SELECTION_DELETE'
      EXPORTING
        IV_SELID                    = DEL_PROFILE
      IV_FLG_CONFIRM_TRANS        = 'X'
    EXCEPTIONS
      NO_ENTRY                    = 1
      NO_AUTHORITY                = 2
      DELETION_NOT_POSSIBLE       = 3
      OTHERS                      = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.
    ENDIF.
    <b>INCLUDE   ZAPO_DATA_DECLARATION_PPF .</b>
    types: t_ts_selpo type /sapapo/ts_selpo.
    TYPES: BEGIN OF T_EXEL,
           PROF_DATFRM TYPE DATS,
           PROF_DATTO TYPE DATS,
           FORCAST_FROM TYPE DATS,
           FORCAST_TO TYPE DATS,
           AREA(60),
           BASE(60),
           POPID(60),
           RATING(60),
           RS(60),
           END OF T_EXEL.
    types: begin of t_profile,
           obj(30),
           val(60),
           end of t_profile.
    TYPES: begin of t_profile_name,
           f_name(60),
           end of t_profile_name.
    DATA: G_COUNT TYPE I VALUE 0.
    *TYPES: T_SAVE_SEL LIKE IT_SELECTION.
    data: w_subrc TYPE sy-subrc,
          I_TS_SELPO TYPE Table of t_ts_selpo with header line,
          I_EXEL TYPE Table of t_EXEL with header line.
    DATA: IV_GROUP TYPE /SAPAPO/IOBJNM.
    DATA: IT_PROFILE_NAME TYPE TABLE OF T_PROFILE_NAME WITH HEADER LINE.
    data: i_profile type table of t_profile with header line.
    */sapapo/ts_iobj_selection_tab.
    data: IT_SEL_SAVE TYPE /sapapo/ts_iobj_selection_tab,
          w_SEL_SAVE type /SAPAPO/TS_IOBJ_SELECTION.
    DATA: IT_CONFIRM_SEL TYPE /SAPAPO/SH_SEL_RANGE_TAB,
          W_CONFIRM_SEL TYPE /SAPAPO/SH_SEL_RANGE_STR.
    TYPES: BEGIN OF T_SAVE_SEL,
           IOBJNM(30),
           SIGN,
           OPTION(2),
           LOW(60),
           HIGH(60),
           END OF T_SAVE_SEL.
    DATA: IT_SAVE_SEL TYPE TABLE OF T_SAVE_SEL WITH HEADER LINE.
    TYPES: BEGIN OF T_GRP,
          OBJNAM(30),
          END OF T_GRP.
    DATA: IT_GRP TYPE TABLE OF T_GRP WITH HEADER LINE.
    DATA DECLARATION FOR FUNC MODULE **************
    DATA: IT_GROUP TYPE /SAPAPO/TS_GROUP_BY_TAB,
          W_GROUP TYPE /SAPAPO/TS_GROUP_BY_STR.
    DATA: G_PAREAID TYPE /SAPAPO/TS_PAREAID,
          G_MVIEW TYPE /SAPAPO/PB_MVIEW,
          G_NAME TYPE /SAPAPO/TS_SEL_DESCR.
    BDC TABLES ***************************
    DATA: bdcdata LIKE bdcdata  OCCURS 0 WITH HEADER LINE.
    DATA: it_messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA : BDCTAB like BDCDATA occurs 0 with header line.
    DATA : w_file type string.
    ****************BDC ERROR TAB ***************************
    DATA : xcount1 TYPE i,
           xstat TYPE i,
           xmsgv1 LIKE balm-msgv1,
           xmsgv2 LIKE balm-msgv2,
           xmsgv3 LIKE balm-msgv3,
           xmsgv4 LIKE balm-msgv4,
           xmessage(80) TYPE c.
    DATA : BEGIN OF t_errlog OCCURS 0,
            sno TYPE i,
            message(80) TYPE c,
            END OF t_errlog.
    DATA: DEL_PROFILE TYPE /SAPAPO/SELECTIONID2,
          DEL_NAME(60).
    ************DUPLICATE NAME TAB **************************
    DATA: IT_NOT_PROCESSED TYPE TABLE OF /SAPAPO/TS_SELPO WITH HEADER LINE.
    DELETE TAB *****************************
    DATA: IT_TS_SELKO TYPE TABLE OF /SAPAPO/TS_SELKO WITH HEADER LINE.
    SELECTION-SCREEN : BEGIN OF BLOCK b1.
    parameters: p_file1 TYPE rlgrap-filename.
    parameters: create type c radiobutton group g1,
                calc_ppf type c radiobutton group g1,
                del_prof type c radiobutton group g1.
    SELECTION-SCREEN END OF BLOCK b1.
    Include           Z_APO_FORMS_PPF
    *&  Include           Z_APO_FORMS_PPF
    *&      Form  READ_DATA
          text
         -->P_I_PROFILE  text
         -->P_I_EXEL  text
         -->P_IT_PROFILE_NAME  text
         -->P_P_FILE1  text
         <--P_W_SUBRC  text
    FORM READ_DATA  TABLES   P_I_PROFILE STRUCTURE I_PROFILE
                             P_I_EXEL STRUCTURE I_EXEL
                             P_IT_PROFILE_NAME STRUCTURE IT_PROFILE_NAME
                    USING    P_P_FILE1
                    CHANGING P_W_SUBRC.
    DATA : iexcel LIKE zexcel_read OCCURS 0 WITH HEADER LINE,
             G_DATE TYPE DATS.
    data: l_name(60).
      CLEAR  p_w_subrc.
      CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename    = p_p_file1
          i_begin_col = 1
          i_begin_row = 1
          i_end_col   = 62
          i_end_row   = 50000
        TABLES
          intern      = iexcel.
       EXCEPTIONS
         inconsistent_parameters = 1
         upload_ole              = 2
         OTHERS                  = 3.
      IF sy-subrc <> 0.
        p_w_subrc = 0 .
    endif.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT iexcel WHERE row > 1.
        IF iexcel-col = '0001'.
        PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
        p_i_EXEL-PROF_DATFRM = G_DATE.
        ENDIF.
        IF iexcel-col = '0002'.
        PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
          p_i_EXEL-PROF_DATTO  = G_DATE.
           ENDIF.
        IF iexcel-col = '0003'.
        PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
          p_i_EXEL-FORCAST_FROM = G_DATE.
        ENDIF.
        IF iexcel-col = '0004'.
        PERFORM CONVERT_DATE CHANGING G_DATE iexcel-value.
          p_i_EXEL-FORCAST_TO = G_DATE.
        ENDIF.
        IF iexcel-col = '0005'.
          p_i_EXEL-AREA = iexcel-value.
          p_i_profile-obj = 'ZRSAREA'.
          p_i_profile-VAL = iexcel-value.
          append p_i_PROFILE.
          clear p_i_PROFILE.
        ENDIF.
        IF iexcel-col = '0006'.
          p_i_EXEL-BASE = iexcel-value.
          p_i_profile-obj = 'ZRSBASPCK'.
          p_i_profile-VAL = iexcel-value.
             append p_i_PROFILE.
          clear p_i_PROFILE.
        ENDIF.
        IF iexcel-col = '0007'.
          p_i_EXEL-POPID = iexcel-value.
          p_i_profile-obj = 'ZRSPOPULN'.
          p_i_profile-VAL = iexcel-value.
             append p_i_PROFILE.
          clear p_i_PROFILE.
        ENDIF.
        IF iexcel-col = '0008'.
        p_i_EXEL-RATING = iexcel-value.
        ENDIF.
        IF iexcel-col = '0009'.
          p_i_EXEL-RS = iexcel-value.
          p_i_profile-obj = 'ZRSCUSTMR'.
          p_i_profile-VAL = iexcel-value.
          append p_i_PROFILE.
          clear p_i_PROFILE.
        ENDIF.
        at end of row.
          append p_i_EXEL.
          clear p_i_EXEL.
        endat.
      endloop.
    loop at P_I_EXEL.
    concatenate P_I_EXEL-AREA P_I_EXEL-BASE INTO L_NAME.
    P_it_profile_name-f_name = l_name.
    append P_it_profile_name.
    ENDLOOP.
    ENDFORM.                    " READ_DATA
    *&      Form  CONVERT_DATE
          text
         <--P_G_DATE  text
         <--P_IEXCEL_VALUE  text
    FORM CONVERT_DATE  CHANGING P_G_DATE
                                P_IEXCEL_VALUE.
                                CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
        DATE_EXTERNAL                  = p_iexcel_value
      ACCEPT_INITIAL_DATE            =
    IMPORTING
       DATE_INTERNAL                  = p_g_date
    EXCEPTIONS
      DATE_EXTERNAL_IS_INVALID       = 1
      OTHERS                         = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " CONVERT_DATE
    *&      Form  SAVE_SELECTION
          text
         -->P_I_EXEL  text
         -->P_IT_SAVE_SEL  text
         -->P_IT_PROFILE_NAME  text
    FORM SAVE_SELECTION  TABLES   P_I_EXEL STRUCTURE I_EXEL
                                  P_IT_SAVE_SEL STRUCTURE IT_SAVE_SEL
                                  P_IT_PROFILE_NAME STRUCTURE IT_PROFILE_NAME.
    DATA: L_PAREAID(40).
    loop at p_i_exel.
    p_it_save_sel-iobjnm = '9AVERSION'.
    p_it_save_sel-SIGN = 'I'.
    p_it_save_sel-OPTION = 'EQ'.
    p_it_save_sel-LOW = '000'.
    APPEND P_IT_SAVE_SEL.
    CLEAR P_IT_SAVE_SEL.
    p_it_save_sel-iobjnm = 'ZRSAREA'.
    p_it_save_sel-SIGN = 'I'.
    p_it_save_sel-OPTION = 'EQ'.
    p_it_save_sel-LOW = P_I_EXEL-AREA.
    APPEND P_IT_SAVE_SEL.
    CLEAR P_IT_SAVE_SEL.
    IF NOT P_I_EXEL-BASE IS INITIAL.
    p_it_save_sel-iobjnm = 'ZRSBASPCK'.
    p_it_save_sel-SIGN = 'I'.
    p_it_save_sel-OPTION = 'EQ'.
    p_it_save_sel-LOW = P_I_EXEL-BASE.
    ENDIF.
    APPEND P_IT_SAVE_SEL.
    CLEAR P_IT_SAVE_SEL.
    IF NOT P_I_EXEL-POPID IS INITIAL.
    p_it_save_sel-iobjnm = 'ZRSPOPULN'.
    p_it_save_sel-SIGN = 'I'.
    p_it_save_sel-OPTION = 'EQ'.
    p_it_save_sel-LOW = P_I_EXEL-POPID.
    APPEND P_IT_SAVE_SEL.
    CLEAR P_IT_SAVE_SEL.
    ENDIF.
    IF NOT P_I_EXEL-RS IS INITIAL.
    p_it_save_sel-iobjnm = 'ZRSCUSTMR'.
    p_it_save_sel-SIGN = 'I'.
    p_it_save_sel-OPTION = 'EQ'.
    p_it_save_sel-LOW = P_I_EXEL-RS.
    APPEND P_IT_SAVE_SEL.
    CLEAR P_IT_SAVE_SEL.
    ENDIF.
    write 'hi'.
    *CLEAR P_IT_SAVE_SEL[].
    ENDLOOP.
    *submit
    ENDFORM.                    " SAVE_SELECTION
    *&      Form  CALC_PPF
          text
         -->P_I_EXEL  text
         -->P_BDCTAB  text
         -->P_IT_PROFILE_NAME  text
    FORM CALC_PPF  TABLES   P_I_EXEL STRUCTURE I_EXEL
                            P_BDCTAB STRUCTURE BDCTAB
                            P_IT_PROFILE_NAME STRUCTURE IT_PROFILE_NAME.
    DATA: PERIOD_FROM TYPE /SAPAPO/BASIS_VON_BIS,
          PERIOD_TO TYPE /SAPAPO/BASIS_VON_BIS,
          TRANSFER_FORM TYPE /SAPAPO/TARGET_VON_BIS,
          TRANSFER_TO TYPE /SAPAPO/TARGET_VON_BIS,
          SEL_PROFILE TYPE /SAPAPO/SEL_TXT.
    DATA: SEL_NAME(60).
    DATA : L_TEMP TYPE SY-DATUM,
           L_TEMP1 TYPE SY-DATUM,
           L_TEMP2 TYPE SY-DATUM,
           L_TEMP3 TYPE SY-DATUM.
    LOOP AT P_I_EXEL.
    L_TEMP0(2) = P_I_EXEL-FORCAST_FROM6(2). "passed date
    L_TEMP2(2) = P_I_EXEL-FORCAST_FROM4(2). "passed Month
    L_TEMP4(4) = P_I_EXEL-FORCAST_FROM0(4). "passed year
    L_TEMP10(2) = P_I_EXEL-FORCAST_TO6(2). "passed date
    L_TEMP12(2) = P_I_EXEL-FORCAST_TO4(2). "passed Month
    L_TEMP14(4) = P_I_EXEL-FORCAST_TO0(4). "passed year
    L_TEMP20(2) = P_I_EXEL-PROF_DATFRM6(2). "passed date
    L_TEMP22(2) = P_I_EXEL-PROF_DATFRM4(2). "passed Month
    L_TEMP24(4) = P_I_EXEL-PROF_DATFRM0(4). "passed year
    L_TEMP30(2) = P_I_EXEL-PROF_DATTO6(2). "passed date
    L_TEMP32(2) = P_I_EXEL-PROF_DATTO4(2). "passed Month
    L_TEMP34(4) = P_I_EXEL-PROF_DATTO0(4). "passed year
    PERIOD_FROM = L_TEMP2.
    PERIOD_TO = L_TEMP3.
    transfer_form = L_TEMP.
    TRANSFER_TO = L_TEMP1.
    concatenate P_I_EXEL-AREA P_I_EXEL-BASE INTO SEL_NAME.
    SEL_PROFILE = SEL_NAME.
    perform bdc_dynpro      using '/SAPAPO/RMDP_SHARE_VERSION_M' '1000'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'BPAREAID'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ONLI'.
    perform bdc_field       using 'PAREAID'
                                  'ZRSPAHPC'.
    perform bdc_field       using 'FLG_AREA'
                                  'X'.
    perform bdc_field       using 'BPAREAID'
                                  'ZRSPAHPC'.
    perform bdc_dynpro      using '/SAPAPO/RMDP_SHARE_MANAGER' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UCOMM1'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'Z_DATE-HIGH'.
    perform bdc_field       using 'B_VER'
                                  '000'.
    perform bdc_field       using 'B_KENN'
                                  '9AVCORHIST'.
    perform bdc_field       using 'B_DATE-LOW'
                                  PERIOD_FROM.
    perform bdc_field       using 'B_DATE-HIGH'
                                  PERIOD_TO.
    perform bdc_field       using 'VERSION'
                                  '000'.
    perform bdc_field       using 'Z_DATE-LOW'
                                  transfer_form.
    perform bdc_field       using 'Z_DATE-HIGH'
                                  TRANSFER_TO.
    perform bdc_field       using 'FLG_ONE'
                                  'X'.
    perform bdc_dynpro      using '/SAPAPO/RMDP_SHARE_MANAGER' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ONLI'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'SEL_TXT'.
    perform bdc_field       using 'SEL_TXT'
                                   SEL_PROFILE.
    perform bdc_dynpro      using '/SAPAPO/RMDP_SHARE_MANAGER' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EE'.
    perform bdc_dynpro      using '/SAPAPO/RMDP_SHARE_VERSION_M' '1000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ONLI'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'PAREAID'.
    *perform bdc_transaction using '/SAPAPO/MC8V'.
    SELECT SINGLE * FROM /SAPAPO/TS_SELKO INTO IT_TS_SELKO
    WHERE SEL_DESRCIPTION = sel_NAME.
    if sy-subrc = 0.
    call transaction '/SAPAPO/MC8V'
             using bdctab
             mode 'A'
             update 'L'
             messages into it_messtab.
    describe table  it_messtab lines xcount1.
    read table it_messtab index xcount1.
    LOOP AT it_messtab WHERE msgtyp = 'E'
                                     OR msgtyp = 'A'.
                MOVE It_messtab-msgv1 TO xmsgv1.
                MOVE It_messtab-msgv2 TO xmsgv2.
                MOVE It_messtab-msgv3 TO xmsgv3.
                MOVE It_messtab-msgv4 TO xmsgv4.
          CALL FUNCTION 'MESSAGE_PREPARE'
            EXPORTING
             LANGUAGE                     = sy-langu
              msg_id                       = It_messtab-msgid
              msg_no                       = It_messtab-msgnr
             MSG_VAR1                     = xmsgv1
             MSG_VAR2                     = xmsgv2
             MSG_VAR3                     = xmsgv3
             MSG_VAR4                     = xmsgv4
           IMPORTING
             MSG_TEXT                     = xmessage
           EXCEPTIONS
             FUNCTION_NOT_COMPLETED       = 1
             MESSAGE_NOT_FOUND            = 2
             OTHERS                       = 3
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          MOVE sy-tabix TO t_errlog-sno.
          MOVE xmessage TO t_errlog-message.
                APPEND t_errlog.
                CLEAR t_errlog..
              ENDLOOP.
    CLEAR BDCTAB[].
    CLEAR SEL_NAME.
    CLEAR P_I_EXEL.
    endif.
    ENDLOOP.
    ENDFORM.                    " CALC_PPF
    *&      Form  bdc_dynpro
          text
         -->P_0424   text
         -->P_0425   text
    FORM bdc_dynpro  USING PROGRAM DYNPRO.
    CLEAR bdcTAB.
      bdcTAB-program  = program.
      bdcTAB-dynpro   = dynpro.
      bdcTAB-dynbegin = 'X'.
      APPEND bdcTAB.
    ENDFORM.                    " bdc_dynpro
    *&      Form  bdc_field
          text
         -->P_0494   text
         -->P_TRANSFER_FROM  text
    FORM bdc_field  USING FNAM FVAL.
      CLEAR bdcTAB.
      bdcTAB-fnam = fnam.
      bdcTAB-fval = fval.
      APPEND bdcTAB.
    ENDFORM.                    " bdc_field

    Hi,
    As I have not been able to attach the document, I will explain  the problem in full as below:-
    Business scenario - Consider a factory having 5 different customers (which is known as Customer_rs). We need to supply stock to each of them based on their past consumption. So to forecast this, we calculate a factor known as proportional factor based on the data we have for previous months.
    So to calculate the PF for a period, we need to create a profile in /sapapo/sdp94 .
    After creating the profile, the profile can be seen by clicking on SPD94 and going to selection-screen button .
    Then to calculate PF , we need to go to transaction /sapapo/mv8v .
    Here we will have to give the selection id that was saved in SDP94.
    All this process has to be automated and a program has been created to do this.
    A description of how the program works  is as given below.
    When we try to calculate the proportional factor with this program , the following error is obtained :-
    ‘There are no plannable characteristic combinations.’
    We are passing the same parameters that were passed by the SDP94 transaction to the standard function module for saving the selection ids. This is shown in the below screenshots.
    In spite of this we are getting the error.
    Now to delete the selection ids,click on delete option in the program .
    But the problem is even if we click on delete , the PPF data will be stored in the database inspite of deleting the selection profiles .
    Please can anyone help me out with  this .
    Regards,
    Sushanth H.S.
                                                                                    Now we will have to give the selection description
    Now the profile can be seen by going to SDP94 and clicking on selection profile button.
    Now to calculate PF, go to transaction /sapapo/mv8v
    Click on execute and give following inputs
    This will forecast the PF for the period 01.09.2007 to 21.02.2007 based on data from 21.04.2007 to 20.05.2007
    Click on other settings
    Here we will have to give the selection id that was saved in SDP94.
    Click on execute.
    All this process has to be automated and a program was created to do this.
    A description of how the program is given below.
    Program zrsnorms_ppf
    Execute.
    Give file path of excel sheet.
    Execute.
    This will create the selection id by taking “ areabasepackRS” as name of id.
    This is the excel sheet that is used to load data into /sapapo/mc8v to calculate the PF.
    Upon executing, the ids have been created
    The new selection ids can be seen by going to /sapapo/sdp94
    And clicking on selection profile.
    Parameters passed to standard function module in order to save the selection id.
    Now if we try to calculate PF using the program, the following happens
    When executed,
    BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
    An error screen is generated with the message ‘There are no plannable characteristic combinations.’
    We are passing the same parameters that were passed by the SDP94 transaction to the standard function module for saving the selection ids. This is shown in the below screenshots.
    In spite of this we are getting the error.
    When IV_POPUP_SEL_DESCRIPTION is passed, a popup will be displayed where the selection description will have to be entered. I am passing the same selection description here as is picked by the program.( H3HPCDEL00110096, H3HPCDEL00110063)
    To avoid this, we need to go to SDP94 and after going to selection window, we need to save the selections as shown in the following screenshots.
    Select the selection id one by one.
    Click on save selection
    Click on save.
    Do the same for all ids created by the program.
    Now if we try to calculate the PF using the program, it is seen to work
    So what needs to be done is that we need to avoid going to SDP94 in order to save the selections after the ids are created by the program.
    How the Program works
    Se38
    Program zrsnorms_ppf
    Execute.
    Give file path of excel sheet.
    Execute.
    This will create the selection id by taking “ areabasepackRS” as name of id.
    The new selection ids can be seen by going to /sapapo/sdp94
    And clicking on selection profile.
    Now the selection has to be saved. For that, follow the following procedure.
    Click on selection window.
    Click on load selection.
    Select the ids.
    Select and then press “save”.
    Do the same for every id.
    Only then can proportional factor be calculated.
    Now go to program and select Calc_ppf, with filepath to excel sheet as the sel_ids will be pulled from the excel.
    When executed,
    BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
    Now go to sdp94 and load the selection
    Click on load data.
    And make sure, data view is TDP_VIEW_PROP as shown
    PPF will be shown for the period chosen in the excel sheet.
    Now to delete the selection ids.
    Go to the program and give file path of the excel sheet and execute.
    The selection profiles will be deleted as shown.
    But PPF data will be stored in the database inspite of deleting the selection profiles. And ppf can be shown by selecting the basepack and the sales area.
    Click load data.
    Business scenario - Consider a factory having 5 different customers (which is known as Customer_rs). We need to supply stock to each of them based on their past consumption. So to forecast this, we calculate a factor known as proportional factor based on the data we have for previous months.
    So to calculate the PF for a period, we need to create a profile in /sapapo/sdp94
    How it is done in standard transaction /SAPAPO/SDP94
    Important pushbuttons and their functions
    Click on selection window.
    Give the selections
    Click on save selection
    A break-point has been set in the standard program to show what all parameters are being passed to the standard function module /SAPAPO/MCPSH_SELECTION_SAVE used to save the selection
    Now we will have to give the selection description
    Now the profile can be seen by going to SDP94 and clicking on selection profile button.
    Now to calculate PF, go to transaction /sapapo/mv8v
    Click on execute and give following inputs
    This will forecast the PF for the period 01.09.2007 to 21.02.2007 based on data from 21.04.2007 to 20.05.2007
    Click on other settings
    Here we will have to give the selection id that was saved in SDP94.
    Click on execute.
    All this process has to be automated and a program was created to do this.
    A description of how the program is given below.
    Program zrsnorms_ppf
    Execute.
    Give file path of excel sheet.
    Execute.
    This will create the selection id by taking “ areabasepackRS” as name of id.
    This is the excel sheet that is used to load data into /sapapo/mc8v to calculate the PF.
    Upon executing, the ids have been created
    The new selection ids can be seen by going to /sapapo/sdp94
    And clicking on selection profile.
    Parameters passed to standard function module in order to save the selection id.
    Now if we try to calculate PF using the program, the following happens
    When executed,
    BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
    An error screen is generated with the message ‘There are no plannable characteristic combinations.’
    We are passing the same parameters that were passed by the SDP94 transaction to the standard function module for saving the selection ids. This is shown in the below screenshots.
    In spite of this we are getting the error.
    When IV_POPUP_SEL_DESCRIPTION is passed, a popup will be displayed where the selection description will have to be entered. I am passing the same selection description here as is picked by the program.( H3HPCDEL00110096, H3HPCDEL00110063)
    To avoid this, we need to go to SDP94 and after going to selection window, we need to save the selections as shown in the following screenshots.
    Select the selection id one by one.
    Click on save selection
    Click on save.
    Do the same for all ids created by the program.
    Now if we try to calculate the PF using the program, it is seen to work
    So what needs to be done is that we need to avoid going to SDP94 in order to save the selections after the ids are created by the program.
    How the Program works
    Se38
    Program zrsnorms_ppf
    Execute.
    Give file path of excel sheet.
    Execute.
    This will create the selection id by taking “ areabasepackRS” as name of id.
    The new selection ids can be seen by going to /sapapo/sdp94
    And clicking on selection profile.
    Now the selection has to be saved. For that, follow the following procedure.
    Click on selection window.
    Click on load selection.
    Select the ids.
    Select and then press “save”.
    Do the same for every id.
    Only then can proportional factor be calculated.
    Now go to program and select Calc_ppf, with filepath to excel sheet as the sel_ids will be pulled from the excel.
    When executed,
    BDC is called to input data to transaction /sapapo/mc8v to calculate ppf.
    Now go to sdp94 and load the selection
    Click on load data.
    And make sure, data view is TDP_VIEW_PROP as shown
    PPF will be shown for the period chosen in the excel sheet.
    Now to delete the selection ids.
    Go to the program and give file path of the excel sheet and execute.
    The selection profiles will be deleted as shown.
    But PPF data will be stored in the database inspite of deleting the selection profiles. And ppf can be shown by selecting the basepack and the sales area.
    Click load data.

  • Communication chaneel error

    Hi Experts,
    My scenario is FileRFCFile Syncrinous. All the files being picked up from output tray by the Sender file CC.
    and because of one error file suddenly Sender File CC is not picking remaining all the files in the tray. even after deleting the error file and after stopping and starting the Sender File CC, the new files came in the tray are not getting picked up.
    kindly advice me how to resolve the issue.
    Thanks,
    Siva

    Hi Abhijit,
    Thanks for your reply,
    The Error in auditlog is as ErrorCode: MESSAGE_NOT_FOUND
    and Error Category : XI_J2EE_ADAPTER_XI_HANDLER
    and Error code : CALL_CONSUMER_ERROR
    Earlier somany times i got the same issue and by deleting the error file and restarting the Sender file CC by start and stop, the files has been picked up. But now the file adapter not picking the new files and it is persisting the old messsage id only which was for the error file.
    Thanlks,
    Siva

  • PI File Adapter Error.

    Hi all,
    I am facing one issue in the Production environment.My PI scenario is File to SAP R/3.At the source side file is being kept in one of the shared folder and PI file adapter is picking the file.When network goes down in the middle of processing a file form this shared folder PI file adpater is throwing some error as given below:
    "Bean SMPP_CALL_JAVA_RUNTIME3not found on host XXX, ProgId =AI_RUNTIME_PRD"
    Even though the network comes up after sometime we are getting the error as
    "PERSIST">MESSAGE_NOT_FOUND"
    If we try to reprocess the files it keeps on throwing the error until we remove the corresponding file (whose processing got interrupted) and refresh the cache.Once the corresponding file is removed PI will start processing the remaining files but the moment we keep the file which got stuck in PI it throws the error again "PERSIST">MESSAGE_NOT_FOUND".
    Could someone throw some light on this as i have to remove the file from the source location everytime and reprocess it by renaming the file.
    Thanks,
    Lekshmi.

    Hi all,
    I have gone through the SAP note mentioned by Abhishek.Thanks for that,it will solve my issue.
    But i want to clear my doubt regarding this error message.Whenever there is some network problem i.e. when the adapter fails to contact target system it gives some delievery exception and finally MESSAGE_NOT_FOUND.The same message can be found in the source location when this error is thrown in PI.Could someone provide any link which will explain why PI is throwing such error.I mean why is it unable to find an existing message in the source location???
    In my case whenever it happens i will be informed by the source team that they are not receiving any response(so for the time being i can manage without configuring the alerts as it is not a frequent issue).But i wanted to know what is the root cause for this issue.
    Regards,
    Lekshmi.

  • URGENT: system error - Maual restart possible

    Hi Experts,
    I'm facing a problem in Xi prodoction. Both inbound and outbound are throwing system error - Maual restart possible. The user is restarting manually in order to post the invoice.
    Basically this is retail project, from POS s/w to Xi to SAP R/3. The scenario is file to idoc(inbound) and idoc to file (outbound).
    The error is :
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Interface Determination
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="PERSIST">MESSAGE_NOT_FOUND</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>XML message not found</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    The acknowledgement error is :
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_INV_SND_SERV</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Unable to convert the sender service to an ALE logical system</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    I have gone throw the sdn post and blogs but i'm uable to trace the problem.
    Kindly suggest me ASAP as this is business critical and posting have been stoped.
    Regards,
    Pawan

    Hi,
    Please find the interface determination trace. Hope this will help you to provide some suggestion.
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Interface Determination
      -->
    - <SAP:Trace xmlns:SAP="http://sap.com/xi/XI/Message/30">
      <Trace level="1" type="B" name="IDX_INBOUND_XMB" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">User: XIBGUSER</Trace>
      <Trace level="1" type="T">Language: E</Trace>
      <Trace level="1" type="T">ALE-AUDIT-IDoc-Inbound Handling</Trace>
      <Trace level="1" type="T">IDoc-Inbound-Handling</Trace>
      <Trace level="2" type="T">Tunneling needed?</Trace>
      <Trace level="2" type="T">Partytype = LS fallback to logical system</Trace>
      <Trace level="3" type="T">Sender Interface</Trace>
      <Trace level="3" type="T">WP_PLU.WP_PLU03 urn:sap-com:document:sap:idoc:messages</Trace>
      <Trace level="1" type="T">Syntax-Check-Flag X</Trace>
      <Trace level="1" type="T">IDoc-Tunnel-Flag</Trace>
      <Trace level="1" type="T">Queueid</Trace>
    - <Trace level="1" type="B" name="IDX_IDOC_TO_XML">
      <Trace level="1" type="T">Get the Metadata for port SAPRT2</Trace>
      <Trace level="2" type="T">----
    </Trace>
      <Trace level="2" type="T">IDX_STRUCTURE_GET Details</Trace>
      <Trace level="2" type="T">Port : SAPRT2</Trace>
      <Trace level="2" type="T">IDoctyp : WP_PLU03</Trace>
      <Trace level="2" type="T">Cimtyp :</Trace>
      <Trace level="2" type="T">RFCDest :</Trace>
      <Trace level="2" type="T">Release : 700</Trace>
      <Trace level="2" type="T">Version : 3</Trace>
      <Trace level="2" type="T">Direct : 1</Trace>
      <Trace level="2" type="T">SAPREL : 700</Trace>
      <Trace level="2" type="T">----
    </Trace>
      <Trace level="1" type="T">Convert Segment-Definitions to Types</Trace>
      <Trace level="1" type="T">Make Syntax check of actual Idoc</Trace>
      <Trace level="2" type="T">----
    </Trace>
      <Trace level="2" type="T">IDX_SYNTAX_CHECK</Trace>
      <Trace level="2" type="T">Port : SAPRT2</Trace>
      <Trace level="2" type="T">IDoctyp : WP_PLU03</Trace>
      <Trace level="2" type="T">Cimtyp :</Trace>
      <Trace level="2" type="T">----
    </Trace>
      <Trace level="2" type="T">Create XML-Control Record</Trace>
      <Trace level="2" type="T">Create XML-Data Records</Trace>
      <Trace level="3" type="T">Create data Record E1WPA01</Trace>
      <Trace level="3" type="T">Create data Record E1WPA02</Trace>
      <Trace level="3" type="T">Create data Record E1WPA03</Trace>
      <Trace level="3" type="T">Create data Record E1WPA04</Trace>
      <Trace level="3" type="T">Create data Record E1WPA05</Trace>
      <Trace level="3" type="T">Create data Record E1WPA01</Trace>
      <Trace level="3" type="T">Create data Record E1WPA02</Trace>
      <Trace level="3" type="T">Create data Record E1WPA03</Trace>
      <Trace level="3" type="T">Create data Record E1WPA04</Trace>
      <Trace level="3" type="T">Create data Record E1WPA05</Trace>
      <Trace level="3" type="T">Create data Record E1WPA01</Trace>
      <Trace level="3" type="T">Create data Record E1WPA02</Trace>
      <Trace level="3" type="T">Create data Record E1WPA03</Trace>
      <Trace level="3" type="T">Create data Record E1WPA04</Trace>
      <Trace level="3" type="T">Create data Record E1WPA05</Trace>
      <Trace level="3" type="T">Create data Record E1WPA01</Trace>
      <Trace level="3" type="T">Create data Record E1WPA02</Trace>
      <Trace level="3" type="T">Create data Record E1WPA03</Trace>
      <Trace level="3" type="T">Create data Record E1WPA04</Trace>
      <Trace level="3" type="T">Create data Record E1WPA05</Trace>
      </Trace>
      <Trace level="2" type="T">Partytype = LS fallback to logical system</Trace>
      <Trace level="2" type="T">Set Sender Routing-object</Trace>
      <Trace level="1" type="T">Set Receiver Routing-object</Trace>
      <Trace level="1" type="T">Exit Function IDX_INBOUND_XMB</Trace>
      <Trace level="1" type="T">COMMIT is expected by application !</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-ENTER_XMS" />
    - <!--  ************************************
      -->
      <Trace level="1" type="B" name="CL_XMS_MAIN-SET_START_PIPELINE" />
    - <!--  ************************************
      -->
      <Trace level="3" type="T">XMB was called with external pipeline PID = ENTRY</Trace>
      <Trace level="3" type="T">Getting type of XMB...</Trace>
      <Trace level="1" type="B" name="SXMBCONF-SXMB_GET_XMB_USE" />
      <Trace level="2" type="T">XMB kind = CENTRAL</Trace>
      <Trace level="3" type="T">Start pipeline found</Trace>
      <Trace level="2" type="T">Switch to external start pipeline PID = CENTRAL</Trace>
    - <Trace level="1" type="B" name="CL_XMS_TROUBLESHOOT-ENTER_PLSRV">
      <Trace level="3" type="T">No triggers found. OK.</Trace>
      </Trace>
      <Trace level="1" type="T">****************************************************</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">XMB entry processing</Trace>
      <Trace level="3" type="T">system-ID = XIP</Trace>
      <Trace level="3" type="T">client = 600</Trace>
      <Trace level="3" type="T">language = E</Trace>
      <Trace level="3" type="T">user = XIBGUSER</Trace>
      <Trace level="1" type="Timestamp">2008-03-27T06:35:02Z UTC-7</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">* *</Trace>
      <Trace level="1" type="T">****************************************************</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_UC_EXECUTE" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Message-GUID = DCFBC7EA238100F1B64A00145EDC94EF</Trace>
      <Trace level="1" type="T">PLNAME = CENTRAL</Trace>
      <Trace level="1" type="T">QOS = EO</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PIPELINE_ASYNC" />
    - <!--  ************************************
      -->
      <Trace level="3" type="T">QOS = EO</Trace>
      <Trace level="3" type="T">Message-GUID = DCFBC7EA238100F1B64A00145EDC94EF</Trace>
      <Trace level="1" type="T">Get definition of external pipeline = CENTRAL</Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-LOOKUP_INTERNAL_PL_ID">
      <Trace level="3" type="T">External PLID = CENTRAL</Trace>
      <Trace level="3" type="T">Internal PLID = SAP_CENTRAL</Trace>
      </Trace>
      <Trace level="1" type="T">Get definition of internal pipeline = SAP_CENTRAL</Trace>
      <Trace level="3" type="T">Generate prefixed queue name</Trace>
      <Trace level="1" type="T">Queue name : XBTI0001</Trace>
      <Trace level="1" type="T">Generated prefixed queue name = XBTI0001</Trace>
      <Trace level="1" type="T">Schedule message in qRFC environment</Trace>
      <Trace level="3" type="T">Setup qRFC Scheduler</Trace>
      <Trace level="1" type="T">Setup qRFC Scheduler OK!</Trace>
      <Trace level="3" type="T">Call qRFC .... MsgGuid = DCFBC7EA238100F1B64A00145EDC94EF</Trace>
      <Trace level="3" type="T">Call qRFC .... Version = 000</Trace>
      <Trace level="3" type="T">Call qRFC .... Pipeline = CENTRAL</Trace>
      <Trace level="3" type="T">OK.</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="T">Going to persist message</Trace>
      <Trace level="1" type="T">NOTE: The following trace entries are always lacking</Trace>
      <Trace level="1" type="T">- Exit WRITE_MESSAGE_TO_PERSIST</Trace>
      <Trace level="1" type="T">- Exit CALL_PIPELINE_ASYNC</Trace>
      <Trace level="1" type="T">Async barrier reached. Bye-bye !</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="3" type="T">Version number = 000</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    - <!--  ************************************
      -->
      <Trace level="3" type="T">Persisting message Status = 001</Trace>
      <Trace level="3" type="T">Message version 000</Trace>
      <Trace level="3" type="T">Pipeline CENTRAL</Trace>
      <Trace level="1" type="T">--start sender interface action determination</Trace>
      <Trace level="1" type="T">select interface WP_PLU.WP_PLU03*</Trace>
      <Trace level="1" type="T">select interface namespace urn:sap-com:document:sap:idoc:messages</Trace>
      <Trace level="1" type="T">no interface found</Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-PERSIST_READ_MESSAGE">
      <Trace level="3" type="T">Trace object available again now. OK.</Trace>
      <Trace level="3" type="T">Message was read from persist layer. OK.</Trace>
      <Trace level="3" type="T">Message properties in XMB object were setup. OK.</Trace>
      <Trace level="3" type="ToDo">Make sure we catch exceptions in persist read</Trace>
      <Trace level="3" type="ToDo">Tracing obj. not avail. before return of CL_XMS_MAIN-PERSIST_READ_MESSAGE</Trace>
      </Trace>
      <Trace level="1" type="T">Note: the following trace entry is written delayed (after read from persist)</Trace>
      <Trace level="1" type="B" name="SXMS_ASYNC_EXEC" />
    - <!--  ************************************
      -->
      <Trace level="3" type="T">message version successfully read from persist version= 000</Trace>
      <Trace level="2" type="T">Increment log sequence to 001</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="T">Starting async processing with pipeline CENTRAL</Trace>
      <Trace level="3" type="T">system-ID = XIP</Trace>
      <Trace level="3" type="T">client = 600</Trace>
      <Trace level="3" type="T">language = E</Trace>
      <Trace level="3" type="T">user = XIBGUSER</Trace>
      <Trace level="1" type="Timestamp">2008-03-27T06:35:03Z UTC-7</Trace>
      <Trace level="1" type="T">----
    </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PIPELINE_SYNC" />
    - <!--  ************************************
      -->
      <Trace level="1" type="T">Get definition of external pipeline CENTRAL</Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-LOOKUP_INTERNAL_PL_ID">
      <Trace level="3" type="T">External PLID = CENTRAL</Trace>
      <Trace level="3" type="T">Internal PLID = SAP_CENTRAL</Trace>
      </Trace>
      <Trace level="1" type="T">Corresponding internal pipeline SAP_CENTRAL</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">Pipeline attributes</Trace>
      <Trace level="3" type="T">PID = SAP_CENTRAL</Trace>
      <Trace level="3" type="T">ENABLE = 1</Trace>
      <Trace level="3" type="T">TRACELEVEL = 0</Trace>
      <Trace level="3" type="T">EXEMODE = A</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T" />
      <Trace level="3" type="T">Pipeline elements</Trace>
      <Trace level="3" type="T">ELEMPOS = 0001</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_RECEIVER_DETERMINATION</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">FL_DUMMY = 0</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">ELEMPOS = 0002</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_INTERFACE_DETERMINATION</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">FL_DUMMY =</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">ELEMPOS = 0003</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_RECEIVER_MESSAGE_SPLIT</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">FL_DUMMY =</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">ELEMPOS = 0004</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_MAPPING_REQUEST</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">FL_DUMMY =</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">ELEMPOS = 0007</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_OUTBOUND_BINDING</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">FL_DUMMY =</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">ELEMPOS = 0008</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_CALL_ADAPTER</Trace>
      <Trace level="3" type="T">PLSRVTYPE = =SWITCH=</Trace>
      <Trace level="3" type="T">FL_DUMMY =</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">ELEMPOS = 0009</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_MAPPING_RESPONSE</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">FL_DUMMY =</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T" />
      <Trace level="1" type="Timestamp">2008-03-27T06:35:03Z UTC-7 Begin of pipeline processing PLSRVID = CENTRAL</Trace>
    - <Trace level="1" type="B" name="PLSRV_RECEIVER_DETERMINATION">
      <Trace level="1" type="Timestamp">2008-03-27T06:35:03Z UTC-7 Start of pipeline service processing PLSRVID= PLSRV_RECEIVER_DETERMINATION</Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV">
      <Trace level="3" type="T">Calling pipeline service: PLSRV_RECEIVER_DETERMINATION</Trace>
      <Trace level="3" type="T">Reading Pipeline-Service specification...</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">Pipeline service specification (table SXMSPLSRV)</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_RECEIVER_DETERMINATION</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">ADRESSMOD = LOCAL</Trace>
      <Trace level="3" type="T">P_CLASS = CL_RD_PLSRV</Trace>
      <Trace level="3" type="T">P_IFNAME = IF_XMS_PLSRV</Trace>
      <Trace level="3" type="T">P_METHOD = ENTER_PLSRV</Trace>
      <Trace level="3" type="T">FL_LOG =</Trace>
      <Trace level="3" type="T">FL_DUMMY = 0</Trace>
      <Trace level="3" type="T" />
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL">
    - <Trace level="1" type="B" name="CL_RD_PLSRV-ENTER_PLSRV">
      <Trace level="1" type="T">R E C E I V E R - D E T E R M I N A T I O N</Trace>
      <Trace level="1" type="T">Cache Content is up to date</Trace>
      <Trace level="2" type="T">Start without given receiver</Trace>
      <Trace level="2" type="T">Classic Receiver Determination via Rules.</Trace>
      <Trace level="2" type="T">Check conditions for rule line no. 1</Trace>
      <Trace level="2" type="T">...valid Receiver w/o Condition: - e_solutionsPOS</Trace>
      <Trace level="2" type="T">No Receiver found behaviour: 2</Trace>
      <Trace level="2" type="T">Number of Receivers:1</Trace>
      </Trace>
      </Trace>
      </Trace>
      <Trace level="1" type="Timestamp">2008-03-27T06:35:03Z UTC-7 End of pipeline service processing PLSRVID= PLSRV_RECEIVER_DETERMINATION</Trace>
      </Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST">
      <Trace level="3" type="T">Persisting message after plsrv call</Trace>
      <Trace level="3" type="T">Message-Version = 001</Trace>
      <Trace level="3" type="T">Message version 001</Trace>
      <Trace level="3" type="T">Pipeline CENTRAL</Trace>
      </Trace>
    - <Trace level="1" type="B" name="PLSRV_INTERFACE_DETERMINATION">
      <Trace level="1" type="Timestamp">2008-03-27T06:35:03Z UTC-7 Start of pipeline service processing PLSRVID= PLSRV_INTERFACE_DETERMINATION</Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV">
      <Trace level="3" type="T">Calling pipeline service: PLSRV_INTERFACE_DETERMINATION</Trace>
      <Trace level="3" type="T">Reading Pipeline-Service specification...</Trace>
      <Trace level="3" type="T" />
      <Trace level="3" type="T">Pipeline service specification (table SXMSPLSRV)</Trace>
      <Trace level="3" type="T">PLSRVID = PLSRV_INTERFACE_DETERMINATION</Trace>
      <Trace level="3" type="T">PLSRVTYPE =</Trace>
      <Trace level="3" type="T">ADRESSMOD = LOCAL</Trace>
      <Trace level="3" type="T">P_CLASS = CL_ID_PLSRV</Trace>
      <Trace level="3" type="T">P_IFNAME = IF_XMS_PLSRV</Trace>
      <Trace level="3" type="T">P_METHOD = ENTER_PLSRV</Trace>
      <Trace level="3" type="T">FL_LOG =</Trace>
      <Trace level="3" type="T">FL_DUMMY = 0</Trace>
      <Trace level="3" type="T" />
    - <Trace level="1" type="B" name="CL_XMS_MAIN-CALL_PLSRV_LOCAL">
    - <Trace level="1" type="B" name="CL_ID_PLSRV-ENTER_PLSRV">
      <Trace level="1" type="T">I N T E R F A C E - D E T E R M I N A T I O N</Trace>
      <Trace level="1" type="T">Cache Content is up to date</Trace>
      <Trace level="2" type="T">Check conditions for (Inb: Party Srvc If) e_solutionsPOS WP_PLU.WP_PLU03</Trace>
      <Trace level="2" type="T">...valid InbIf without Condition: WP_PLU.WP_PLU03</Trace>
      <Trace level="2" type="T">Number of receiving Interfaces:1</Trace>
      </Trace>
      </Trace>
      </Trace>
      <Trace level="1" type="Timestamp">2008-03-27T06:35:03Z UTC-7 End of pipeline service processing PLSRVID= PLSRV_INTERFACE_DETERMINATION</Trace>
      </Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST">
      <Trace level="3" type="T">Persisting message after plsrv call</Trace>
      <Trace level="3" type="T">Message-Version = 002</Trace>
      <Trace level="3" type="T">Message version 002</Trace>
      <Trace level="3" type="T">Pipeline CENTRAL</Trace>
      </Trace>
    - <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST">
      <Trace level="3" type="T">Persisting message after plsrv call</Trace>
      <Trace level="3" type="T">Message-Version = 002</Trace>
      <Trace level="3" type="T">Message version 002</Trace>
      <Trace level="3" type="T">Pipeline CENTRAL</Trace>
      </Trace>
      <Trace level="3" type="System_Error">Error exception return from pipeline processing!</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    - <!--  ************************************
      -->
      <Trace level="3" type="T">Persisting message Status = 014</Trace>
      <Trace level="3" type="T">Message version 002</Trace>
      <Trace level="3" type="T">Pipeline CENTRAL</Trace>
      </SAP:Trace>
    Thanks,
    Pavan

  • Whenever messages created in XI, initially it will go to error status

    Whenever messages created in XI, initially it will go to error status
    As soon as IDOCs released in ECC system the messages are going to error status. But they are processing successfully later. They are going to error state as soon a they release. Thats the problem.
    Information message "XML message not found". But I am able to see XML message in payload. When I try to reprocess the message it will succeed. It is happening for all the interfaces.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Interface Determination
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="PERSIST">MESSAGE_NOT_FOUND</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>XML message not found</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Please provide any help.

    Hi !
    It seems that the message type / interface message defined in interface determination does not match with one in the message. Are you using the imported IDOC as interface message or did you create a new interface mapping? you should use the imported IDOC in interface  mapping and also in interface determination objects. Also try to reactivate the interface determination object.
    Regards,
    Matias.

  • Generic BDC for VK11 - URGENT

    Hi
    Can any one tell me how to create <b>Generic BDC for  transaction VK11 (Creating condition records)</b>
    My actual requirement is like we need to create <b>condition record</b> for every material  with all the condition types exist for that material  for different key combinations . <b>A condition record for every material is to be created for different condition types and  different key combinations where material MATNR is a key field .For example we need to create condition records dynamically for condition types ZPR0, ZCM0 etc.. for different key combinations where matnr is a key field .</b>
    can anyone of you point out a way to me?
    Thanks in advance
    Shivakumar

    please   copy the  program and  use it 
    *  Report to Upload the pricing condtion records for materials.        *
    *  Program  : ZSDR_PRICE_UPLOAD                                        *
    *  Author   : girish.
    *  Description:                                                        *
    *  This report Creat pricing condition records for materials           *
    * Tables Used :                      SELECT UPDATE INSERT DELETE       *
    * MVKE                                                X                *
    * Input/Output Files:                                                  *
    * Transactions called:                                                 *
    * Includes:                                                            *
    * Run Frequency -                                                      *
    * Program History                                                      *
    * Date       Change No            Change Request   SAP Rel    NSC Rel  *
    *            Description                                               *
    *                                                  4.6C                *
    REPORT zsdr_price_upload  MESSAGE-ID zsdr_bdc_vk11  LINE-SIZE 150
    LINE-COUNT 75 .
    ******Internal Table for Header Data.
    TYPES : BEGIN OF type_header,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr(11) TYPE c,
            datab(10) TYPE c,
            datbi(10) TYPE c,
            END OF type_header.
    ****Internal Table for Item Level.
    TYPES : BEGIN OF type_item,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr(11)  TYPE c,
            datab(10) TYPE c,
            datbi(10) TYPE c,
           END OF type_item.
    ******Error Table For not found in MVKE.
    TYPES : BEGIN OF type_error ,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr LIKE konp-kbetr,
            datab(10) TYPE c,
            datbi(10) TYPE c,
            text(100) TYPE c,
            END OF type_error.
    ****For error Messages
    TYPES : BEGIN OF type_mtab,
            matnr   LIKE mara-matnr,
            msgtyp  LIKE bdcmsgcoll-msgtyp,
            msgid   LIKE bdcmsgcoll-msgid,
            msgnr   LIKE bdcmsgcoll-msgnr,
            text(100) TYPE c,
            END OF type_mtab.
    ****Internal Table
    TYPES: BEGIN OF type_mvke,
           matnr LIKE mvke-matnr,
           vkorg LIKE mvke-vkorg,
           vtweg LIKE mvke-vtweg,
           END OF type_mvke.
    ****Internal Table
    TYPES : BEGIN OF type_tvkov,
            vkorg LIKE tvkov-vkorg,
            vtweg LIKE tvkov-vtweg,
            END OF type_tvkov.
    ** Declaring Internal Tables
    DATA : t_header TYPE STANDARD TABLE OF type_header,
           t_item TYPE STANDARD TABLE OF type_item,
           t_mvke TYPE STANDARD TABLE OF type_mvke,
           t_tvkov TYPE STANDARD TABLE OF type_tvkov,
           t_error TYPE STANDARD TABLE OF type_error,
           t_mtab TYPE STANDARD TABLE OF type_mtab.
    ** Work Area Declaration.
    DATA : wa_header LIKE LINE OF t_header,
           wa_item LIKE LINE OF t_item,
           wa_error LIKE LINE OF t_error,
           wa_mtab LIKE LINE OF t_mtab,
           wa_tvkov LIKE LINE OF t_tvkov,
           wa_mvke LIKE LINE OF t_mvke.
    **Rows for Table with Excel Data********
    DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    ***Constant.
    DATA : c_params LIKE ctu_params.
    DATA : c_ans(1) TYPE c.
    DATA : v_count(4) TYPE c. " To show No.of records
    DATA :  bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE.      " BDCDATA
    DATA :  tmess_mtab  LIKE  bdcmsgcoll OCCURS 10 WITH HEADER LINE.
    **  SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    * END OF SELECTION SCREEN.
    DATA : repid LIKE sy-repid.
    DATA : v_matnr(50) TYPE c, "used for line items
           v_kbetr(50) TYPE c, "used for line items
           v_dat1(50) TYPE c,  "used for line items
           v_dat(50) TYPE c.   "used for line items
    DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
           v_lindx1(5) TYPE n  VALUE '01', "index counter for  13 records.
           v_item(5) TYPE c,  "To increment the line index
           v_pgedwn2  TYPE i . "For Pagedown Counter
    DATA:  v_currentrow TYPE i.  "For Current Row
    DATA  v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
    ************AT SELECTION-SCREEN
    AT SELECTION-SCREEN  ON VALUE-REQUEST FOR p_fname.
      PERFORM get_filename USING p_fname.
    *************START-OF-SELECTION
    START-OF-SELECTION.
    ******Values for Ctu_params to Transaction
      c_params-defsize = 'X'.
      c_params-dismode = 'N'.
      c_params-updmode = 'S'.
    ******Refresh
      PERFORM f_refresh.
    *********To upload File.
      PERFORM upload_file.
    ****User Confrimation only BDC will Process
      IF c_ans = '1'.
    ** *** BDC Process.
        PERFORM read_data.
      ELSE.
        FORMAT COLOR 3 INTENSIFIED .
        WRITE:/ 'Selected not to Process the Upload'.
        EXIT.
      ENDIF.
    ******On completion of  Process Refresh the Internal Table
      REFRESH :  t_xls_file,
                   t_header,
                   t_item,
                   t_mvke,
                   t_tvkov.
      CLEAR :    t_xls_file,
                 wa_header,
                 wa_item,
                 wa_mvke,
                 wa_tvkov.
    ***********Display Messages
      WRITE : /01 'Status',19 'Status Text'.
      WRITE  AT 0(150) sy-uline.
      LOOP AT t_mtab INTO wa_mtab.
        WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
      ENDLOOP.
      SKIP 2.
      SORT t_error BY matnr.
      WRITE  AT 0(150) sy-uline.
      WRITE 'ERROR MESSAGES'.
      WRITE  AT 0(150) sy-uline.
      WRITE :/01 'Material.No',20 'Status Text'.
      WRITE  AT 0(150) sy-uline.
      LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
        WRITE:/01 wa_error-matnr,20 wa_error-text.
      ENDLOOP.
    *&      Form  get_filename
    *       text
    *      -->P_FILENAME  text
    FORM get_filename USING    p_fname.
    *****To read the file from Presentation Server
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
         program_name        =  repid
        dynpro_number      ! ; =   syst-dynnr
          field_name          = p_fname
    *   STATIC              = ' '
        mask                = '*.XLS'
        CHANGING
          file_name           = p_fname
    EXCEPTIONS
       mask_too_long       = 1
       OTHERS              = 2
      IF sy-subrc <> 0.
    * * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *   WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " get_filename
    *&      Form  upload_file
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM upload_file.
      DATA : frow VALUE 2 TYPE i,
             fcol VALUE 1 TYPE i,
             erow VALUE 10000 TYPE i,
             ecol VALUE 7  TYPE i,
             ecol1 VALUE 1 TYPE i,
             c_col1 TYPE i VALUE '0001',
             c_col2 TYPE i VALUE '0002',
             c_col3 TYPE i VALUE '0003',
           &nb! sp; c_col4 TYPE i VALUE '0004',
             c_col5 TYPE i VALUE '0005',
             c_col6 TYPE i VALUE '0006',
             c_col7 TYPE i VALUE '0007'.
    ***FM used to UPLOAD data from Flat file
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_fname
                i_begin_col             = fcol
                i_begin_row             = frow
                i_end_col               = ecol
                i_end_row               = erow
           TABLES
                intern                  = t_xls_file
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        MESSAGE e000.
      ENDIF.
    ****T_XLS_FILE is initial, stop the process & throw message
      IF t_xls_file[] IS INITIAL.
        FORMAT COLOR 6 ON INTENSIFIED ON.
        WRITE:/ 'No Data  Exists '.
        FORMAT COLOR OFF INTENSIFIED OFF.
        STOP.
      ELSE.
    * Sort table by rows and colums
        SORT t_xls_file BY row col.
    * Get first row retrieved
        READ TABLE t_xls_file INDEX 1.
    * Set first row retrieved to current row
        v_currentrow = t_xls_file-row.
    **Loop  to move data in internal Table
        LOOP AT t_xls_file .
    *   Reset values for next row
          IF t_xls_file-row NE v_currentrow.
            APPEND wa_header TO t_header.
            CLEAR wa_header.
            v_currentrow = t_xls_file-row.
          ENDIF.
          CASE t_xls_file-col.
            WHEN  c_col1.                              "Kschl
              wa_header-kschl = t_xls_file-value.
            WHEN c_col2.                              "Vkorg
              wa_header-vkorg = t_xls_file-value.
            WHEN c_col3.                              "vtweg
              wa_header-vtweg = t_xls_file-value.
            WHEN c_col4.                              "Matnr
              wa_header-matnr = t_xls_file-value.
            WHEN c_col5.                              "Kbetr
              wa_header-kbetr = t_xls_file-value.
            WHEN c_col6.                              "FROm
              wa_header-datab   = t_xls_file-value.
            WHEN c_col7.                              "TO
              wa_header-datbi   = t_xls_file-value.
          ENDCASE.
        ENDLOOP.
        APPEND wa_header TO t_header.
        CLEAR wa_header.
      ENDIF.
    ****To process the data
      PERFORM f_process.
    ENDFORM.                    " upload_file
    *&      Form  READ_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM read_data.
    ****To make Uniq Records in Header Level
      SORT t_header BY kschl vkorg vtweg.
      DELETE ADJACENT DUPLICATES FROM t_header COMPARING
                                       kschl vkorg vtweg .
      SORT t_item BY vkorg vtweg matnr.
      DATA : wa1_item TYPE type_item.
      DATA : l_cnt TYPE i.
      DATA : flag(1) TYPE c. "to process the Line item.
    ***Looping Header Table.
      LOOP AT t_header INTO wa_header.
        PERFORM bdc_dynpro      US! ING 'SAPMV13A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV13A-KSCHL'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ANTA'.
        PERFORM bdc_field       USING 'RV13A-KSCHL'
                                      wa_header-kschl.
        PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV130-SELKZ(03)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=WEIT'.
        PERFORM bdc_field       USING 'RV130-SELKZ(03)'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KOMG-VKORG'.
        PERFORM bdc_field       USING 'KOMG-VKORG'
                                       wa_header-vkorg.
        PERFORM bdc_field       USING 'KOMG-VTWEG'
                                       wa_header-vtweg.
    ****To handle Line Items.
        LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
                                      vtweg = wa_header-vtweg.
          wa_item = wa1_item.
    ******Flag Set only After processing  first 14 records .
          IF flag = ' '.
            v_lindx  = v_lindx + 01.
            SHIFT  v_lindx LEFT DELETING LEADING '0'.
            v_item  = v_lindx .
            CONCATENATE 'KOMG-MATNR(' v_item ')'  INTO v_matnr.
            PERFORM bdc_field           USING v_matnr
                                          wa_item-matnr.
            CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
            PERFORM bdc_field       USING v_kbetr
                                          wa_item-kbetr.
            CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
            PERFORM bdc_field       USING  v_dat
                                          wa_item-datab.
            CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
            PERFORM bdc_field       USING  v_dat1
                                          wa_item-datbi.
            IF  v_item = 14.
              flag = 'X'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                  '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
              PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
              CLEAR v_lindx.
              CLEAR v_item.
              CONTINUE.
            ENDIF.
          ENDIF.
    ***Flag is Set  after Processing of 14 records.
    ****** TO process rest of Records
          IF flag = 'X'.
            v_pgedwn2  = v_pgedwn2 + 1.
            v_lindx1  = v_lindx1 + 01.
            SHIFT  v_lindx1 LEFT DE! LETING LEADING '0'.
            v_item  = v_lindx1 .
            CONCATENATE 'KOMG-MATNR(' v_it! em ')'  INTO v_matnr.
            PERFORM bdc_field           USING v_matnr
                                          wa_item-matnr.
            CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
            PERFORM bdc_field       USING v_kbetr
                                          wa_item-kbetr.
            CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
            PERFORM bdc_field       USING  v_dat
                                          wa_item-datab.
            CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
            PERFORM bdc_field       USING  v_dat1
                                          wa_item-datbi.
            IF v_pgedwn2 = 13.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                  '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
              PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
              v_pgedwn2 = 0.
              v_lindx1 = 1.
              CLEAR v_item.
              CONTINUE.
            ENDIF.
          ENDIF.
        ENDLOOP.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                   '=SICH'.
    ****** Calling Transaction after Processing All items.
        CALL TRANSACTION 'VK11' USING bdctab
                           OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
        REFRESH bdctab.
        CLEAR : bdctab.
        CLEAR : wa_item.
        CLEAR : wa1_item.
        CLEAR : wa_header.
        CLEAR : l_cnt.
        CLEAR : v_lindx1.
        CLEAR:  v_pgedwn2,v_lindx.
        LOOP AT tmess_mtab .
          l_cnt =  l_cnt + 1.
          READ TABLE t_item INTO wa_item INDEX l_cnt .
          CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
               EXPORTING
                    arbgb             = tmess_mtab-msgid
                    msgnr             = tmess_mtab-msgnr
                    msgv1             = tmess_mtab-msgv1
                    msgv2             = tmess_mtab-msgv2
                    msgv3             = tmess_mtab-msgv3
                    msgv4           !   = tmess_mtab-msgv4
               IMPORTING
                    msgtext           = wa_mtab-text
               EXCEPTIONS
                    message_not_found = 1
                    OTHERS            = 2.
          IF sy-subrc <> 0.
    *        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          wa_mtab-matnr   = wa_item-matnr.
          wa_mtab-msgtyp  = tmess_mtab-msgtyp.
          wa_mtab-msgid   = tmess_mtab-msgid.
          wa_mtab-msgn! r   = tmess_mtab-msgnr.
          APPEND wa_mtab TO t_mtab.
          CLEAR wa_mtab-text.
          CLEAR wa_item.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " READ_DATA
    *&      Form  BDC_DYNPRO
    *       text
    *      -->P_0300   text
    *      -->P_0301   text
    *        Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdctab.
      bdctab-program  = program.
      bdctab-dynpro   = dynpro.
      bdctab-dynbegin = 'X'.
      APPEND bdctab.
    ENDFORM.                    " BDC_DYNPRO
    *&      Form  BDC_FIELD
    *       text
    *      -->P_0305   text
    *      -->P_WA_HEADER_KSCHL  text
    *        Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdctab.
      bdctab-fnam = fnam.
      bdctab-fval = fval.
      APPEND bdctab.
    ENDFORM.                    " BDC_FIELD
    *&      Form  bdc_trc_ansaction
    *       text
    *      -->P_0527   text
    *&      Form  f_Process
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_process.
      DATA : l_todate(12) TYPE c,
             l_frdate(12) TYPE c.
    ***Select for all entries of material in Header "Flat File Materials".
      IF NOT t_header[] IS INITIAL.
       SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
                               IN t_header WHERE matnr = t_header-matnr AND
                                                 vkorg = t_header-vkorg AND
                                                     vtweg = t_header-vtweg.
      ENDIF.
    *********select Sales.org & Dist.channel.
      IF NOT t_header[] IS INITIAL.
        SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
                                    t_header WHERE vkorg = t_header-vkorg
                                               AND vtweg = t_header-vtweg.
      ENDIF.
    ***Checking for material in Sales Master Table
      SORT t_mvke BY matnr vkorg vtweg.
      SORT t_tvkov BY vkorg vtweg.
      LOOP AT t_header INTO wa_header.
        READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
                                                 vkorg = wa_header-vkorg
                                    ! ;  vtweg = wa_header-vtweg BINARY SEARCH.
        IF sy-subrc <> 0.
          wa_error = wa_header.
        &nb! sp; MOVE text-011 TO  wa_error-text.
          APPEND wa_error TO t_error.
          DELETE TABLE t_header FROM wa_header.
        ELSE.
    ********Date Validations
          IF ( wa_header-datab  NE ' ! ;  '  AND  wa_header-datbi NE  '  ' ) .
            l_todate = wa_header-datab.
            l_frdate = wa_header-datbi.
            REPLACE '.' INTO l_toda! te WITH ''.
            REPLACE '.' INTO l_todate WITH ''.
            CONDENSE l_todate NO-GAPS.
            REPLACE '.' INTO l_frdate WITH ''.
            REPLACE '.' INTO l_frdate WITH ''.
            CONDENSE l_frdate NO-GAPS.
            IF l_frdate < l_todate.
              wa_error = wa_header .
              MOVE text-012 TO wa_error-text.
              APPEND wa_error TO t_error.
              DELETE TABLE t_header FROM wa_header.
            ENDIF.
          ELSE.
            wa_error = wa_header .
            MOVE text-016 TO wa_error-text.
            APPEND wa_error TO t_error.
            DELETE TABLE t_header FROM wa_header.
          ENDIF.
        ENDIF.
    ********Rate Validation.
        IF wa_header-kbetr = '   '.
          wa_error = wa_header .
          MOVE text-017 TO wa_error-text.
          APPEND wa_error TO t_error.
          DELETE TABLE t_header FROM wa_header.
        ENDIF.
        READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
                                                   BINARY SEARCH.
        IF sy-subrc  = 0.
          READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
                                                       BINARY SEARCH.
          IF sy-subrc  <> 0.
            wa_error = wa_header.
            MOVE text-015 TO  wa_error-text.
            WRITE wa_header-vtweg TO wa_error-text+13(4).
            APPEND wa_error TO t_error.
          ENDIF.
        ELSE.
          wa_error = wa_header.
          MOVE text-013 TO  wa_error-text.
          WRITE wa_header-vkorg TO wa_error-text+9(4).
          APPEND wa_error TO t_error.
        ENDIF.
        CLEAR wa_header.
      ENDLOOP.
    *****Deleting Duplicate Material  Form Header "Flat File Data".
      SORT t_header BY kschl vkorg vtweg matnr.
      DELETE ADJACENT DUPLICATES FROM t_header COMPARING
            kschl! vkorg vtweg matnr .
    *  ****Data Moving from Header to Item Level.
      t_item[] = t_header[].
    *To count No.of records in Item Table.
      DESCRIBE TABLE t_item  LINES v_count.
      CONCATENATE text-014 ' ' v_count INTO  v_bdc.
    ****Popup to get Confirmation from user to process BDC
      CALL FUNCTION 'POPUP_TO_CONFIRM'
           EXPORTING
                titlebar       = 'Confirmation of File Data'
                text_question  = v_bdc
                text_button_1  = 'Confirm'
                text_button_2  = 'Cancel Run'
                default_button = '1'
           IMPORTING
                answer         = c_ans.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-! MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " f_Process
    *&      Form  f_Refresh
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f_refresh.
      REFRESH :  t_xls_file,
                 t_header,
                 t_item,
                 t_mvke,
                 t_tvkov,
                 t_error,
                 t_mtab.
      CLEAR :    t_xls_file,
                 wa_header,
                 wa_item,
                 wa_mvke,
                 wa_tvkov,
                 wa_error,
                 wa_mtab.
    ENDFORM.                    " f_Refresh
    reward  point s  if it is usefull ....
    girish

  • Bapi wrapper- MODIFY Wrapper For SyncBo

    Modify Wrapper :ZGET_AM_P2P For SyncBO
    I have read the requirement :
    -replace entire item data with entries of table parameters
    pls tell me the code will work or not if i put in syncBo
    someone pls help me.....
    FUNCTION ZGET_AM_P2P.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(V_ANLN) LIKE  ANLA-ANLN1 OPTIONAL
    *"     VALUE(V_STORT) LIKE  ANLZ-STORT OPTIONAL
    *"  EXPORTING
    *"     VALUE(V_MSG) TYPE  STRING
      TABLES : anla, anlz, anlh.
      DATA : v_date LIKE sy-datum,
             var1 like  BALM-MSGV1,
             var2 like  BALM-MSGV2.
      refresh : bdcdata, messtab.
      clear : bdcdata, messtab, v_msg, v_date.
      SELECT SINGLE * FROM anla WHERE anln1 = v_anln
                                  AND bukrs = '1000'.
      SELECT SINGLE * FROM anlz WHERE anln1 = v_anln
                                  AND bukrs = '1000'.
      SELECT SINGLE * FROM anlh WHERE anln1 = v_anln
                                  AND bukrs = '1000'.
      CONCATENATE   anla-aktiv6(02)  anla-aktiv4(02) anla-aktiv(04) INTO v_date.
      CALL FUNCTION 'ZBAPI_AM_P2P'
       EXPORTING
         V_ANLN          = ANLA-ANLN1
         V_STORT         = v_STORT
         V_TXT50         = ANLA-TXT50
         V_ANLHTXT       = ANLH-ANLHTXT
         V_KOSTL         = ANLZ-KOSTL
         V_WERKS         = ANLZ-WERKS
         V_DATE          = v_date
       IMPORTING
         V_MSG           = v_msg
    ENDFUNCTION.
    FUNCTION zbapi_am_p2p.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(V_ANLN) LIKE  ANLA-ANLN1 OPTIONAL
    *"     VALUE(V_STORT) LIKE  ANLZ-STORT OPTIONAL
    *"     VALUE(V_TXT50) LIKE  ANLA-TXT50 OPTIONAL
    *"     VALUE(V_ANLHTXT) LIKE  ANLH-ANLHTXT OPTIONAL
    *"     VALUE(V_KOSTL) LIKE  ANLZ-KOSTL OPTIONAL
    *"     VALUE(V_WERKS) LIKE  ANLZ-WERKS OPTIONAL
    *"     VALUE(V_DATE) LIKE  SY-DATUM OPTIONAL
    *"  EXPORTING
    *"     VALUE(V_MSG) TYPE  STRING
      DATA :  var1 LIKE  balm-msgv1,
              var2 LIKE  balm-msgv2.
      PERFORM open_group.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=MAST'.
      PERFORM bdc_field       USING 'ANLA-ANLN1' v_anln.
      PERFORM bdc_field       USING 'ANLA-ANLN2' '0'.
      PERFORM bdc_field       USING 'ANLA-BUKRS' '1000'.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '1000'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=TAB02'.
      PERFORM bdc_field       USING 'ANLA-TXT50' v_txt50.
      PERFORM bdc_field       USING 'ANLH-ANLHTXT' v_anlhtxt.
      PERFORM bdc_field       USING 'ANLA-AKTIV' v_date.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '1000'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=BUCH'.
      PERFORM bdc_field       USING 'ANLZ-KOSTL' v_kostl.
      PERFORM bdc_field       USING 'ANLZ-WERKS' v_werks.
      PERFORM bdc_field       USING 'ANLZ-STORT' v_stort.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '3020'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=YES'.
      CALL TRANSACTION 'AS02' USING bdcdata MODE 'N'
                                            UPDATE 'S'
                                            MESSAGES INTO messtab.
      PERFORM close_group.
      READ TABLE messtab INDEX 1.
      MOVE messtab-msgv1 TO var1.
      MOVE messtab-msgv2 TO var2.
      CLEAR v_msg.
      CALL FUNCTION 'MESSAGE_PREPARE'
           EXPORTING
               language               = 'E'
                msg_id                 = messtab-msgid
                msg_no                 = messtab-msgnr
                msg_var1               = var1
                msg_var2               = var2
            MSG_VAR3               = ' '
            MSG_VAR4               = ' '
          IMPORTING
               msg_text               = v_msg
           EXCEPTIONS
                function_not_completed = 1
                message_not_found      = 2
                OTHERS                 = 3.
    ENDFUNCTION.
    Message was edited by:
            yzme yzme

    Hi Saptak,
    Good to see that you had gone through earlier posts & SAP notes.
    Record not on device errors occurs when a mobile user tries to modify a record which currently doesn't belongs to him anymore. Since you have an S01 syncBO, the object he is trying to modify now is deleted from MI. ( This doesn't mean the object is deleted from backend. Basically the Getlist bapi is now not returning this object)
    This occurs only if the sync mode is "async". There is nothing to be worried about. This is just an expected behaviour. If you feel the update is important and needs to be sent to the backend, set the parameter REPROCESS_ON_NO_DATA to 'X' and reprocess the worklist.
    When you reprocess, the Getdetail bapi will be called and the user changes are merged to the latest backend data. No conflict check done and hence there is a chance of backend changes getting overwritten. If the particular record is only updated by mobile user, then there is nothing to worry..
    Let me know if you need more clarifications...
    Regards
    Ajith

  • Very urgent - bdc

    How to transfer the error records from internal table to the excel file in the
    BDC - Call Transaction method?
    Thanks in advance

    Hi,
        Try the follwong code
    REPORT zsdr_price_upload  MESSAGE-ID zsdr_bdc_vk11  LINE-SIZE 150
    LINE-COUNT 75 .
    ******Internal Table for Header Data.
    TYPES : BEGIN OF type_header,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr(11) TYPE c,
            datab(10) TYPE c,
            datbi(10) TYPE c,
            END OF type_header.
    ****Internal Table for Item Level.
    TYPES : BEGIN OF type_item,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr(11)  TYPE c,
            datab(10) TYPE c,
            datbi(10) TYPE c,
           END OF type_item.
    ******Error Table For not found in MVKE.
    TYPES : BEGIN OF type_error ,
            kschl LIKE konv-kschl,
            vkorg LIKE vbak-vkorg,
            vtweg LIKE komg-spart,
            matnr LIKE mvke-matnr,
            kbetr LIKE konp-kbetr,
            datab(10) TYPE c,
            datbi(10) TYPE c,
            text(100) TYPE c,
            END OF type_error.
    ****For error Messages
    TYPES : BEGIN OF type_mtab,
            matnr   LIKE mara-matnr,
            msgtyp  LIKE bdcmsgcoll-msgtyp,
            msgid   LIKE bdcmsgcoll-msgid,
            msgnr   LIKE bdcmsgcoll-msgnr,
            text(100) TYPE c,
            END OF type_mtab.
    ****Internal Table
    TYPES: BEGIN OF type_mvke,
           matnr LIKE mvke-matnr,
           vkorg LIKE mvke-vkorg,
           vtweg LIKE mvke-vtweg,
           END OF type_mvke.
    ****Internal Table
    TYPES : BEGIN OF type_tvkov,
            vkorg LIKE tvkov-vkorg,
            vtweg LIKE tvkov-vtweg,
            END OF type_tvkov.
    Declaring Internal Tables
    DATA : t_header TYPE STANDARD TABLE OF type_header,
           t_item TYPE STANDARD TABLE OF type_item,
           t_mvke TYPE STANDARD TABLE OF type_mvke,
           t_tvkov TYPE STANDARD TABLE OF type_tvkov,
           t_error TYPE STANDARD TABLE OF type_error,
           t_mtab TYPE STANDARD TABLE OF type_mtab.
    Work Area Declaration.
    DATA : wa_header LIKE LINE OF t_header,
           wa_item LIKE LINE OF t_item,
           wa_error LIKE LINE OF t_error,
           wa_mtab LIKE LINE OF t_mtab,
           wa_tvkov LIKE LINE OF t_tvkov,
           wa_mvke LIKE LINE OF t_mvke.
    *Rows for Table with Excel Data*******
    DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    ***Constant.
    DATA : c_params LIKE ctu_params.
    DATA : c_ans(1) TYPE c.
    DATA : v_count(4) TYPE c. " To show No.of records
    DATA :  bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE.      " BDCDATA
    DATA :  tmess_mtab  LIKE  bdcmsgcoll OCCURS 10 WITH HEADER LINE.
    SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    END OF SELECTION SCREEN.
    DATA : repid LIKE sy-repid.
    DATA : v_matnr(50) TYPE c, "used for line items
           v_kbetr(50) TYPE c, "used for line items
           v_dat1(50) TYPE c,  "used for line items
           v_dat(50) TYPE c.   "used for line items
    DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
           v_lindx1(5) TYPE n  VALUE '01', "index counter for  13 records.
           v_item(5) TYPE c,  "To increment the line index
           v_pgedwn2  TYPE i . "For Pagedown Counter
    DATA:  v_currentrow TYPE i.  "For Current Row
    DATA  v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
    ************AT SELECTION-SCREEN
    AT SELECTION-SCREEN  ON VALUE-REQUEST FOR p_fname.
      PERFORM get_filename USING p_fname.
    *************START-OF-SELECTION
    START-OF-SELECTION.
    ******Values for Ctu_params to Transaction
      c_params-defsize = 'X'.
      c_params-dismode = 'N'.
      c_params-updmode = 'S'.
    ******Refresh
      PERFORM f_refresh.
    *********To upload File.
      PERFORM upload_file.
    ****User Confrimation only BDC will Process
      IF c_ans = '1'.
    *** BDC Process.
        PERFORM read_data.
      ELSE.
        FORMAT COLOR 3 INTENSIFIED .
        WRITE:/ 'Selected not to Process the Upload'.
        EXIT.
      ENDIF.
    ******On completion of  Process Refresh the Internal Table
      REFRESH :  t_xls_file,
                   t_header,
                   t_item,
                   t_mvke,
                   t_tvkov.
      CLEAR :    t_xls_file,
                 wa_header,
                 wa_item,
                 wa_mvke,
                 wa_tvkov.
    ***********Display Messages
      WRITE : /01 'Status',19 'Status Text'.
      WRITE  AT 0(150) sy-uline.
      LOOP AT t_mtab INTO wa_mtab.
        WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
      ENDLOOP.
      SKIP 2.
      SORT t_error BY matnr.
      WRITE  AT 0(150) sy-uline.
      WRITE 'ERROR MESSAGES'.
      WRITE  AT 0(150) sy-uline.
      WRITE :/01 'Material.No',20 'Status Text'.
      WRITE  AT 0(150) sy-uline.
      LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
        WRITE:/01 wa_error-matnr,20 wa_error-text.
      ENDLOOP.
    *&      Form  get_filename
          text
         -->P_FILENAME  text
    FORM get_filename USING    p_fname.
    *****To read the file from Presentation Server
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
       EXPORTING
         program_name        =  repid
        dynpro_number      ! ; =   syst-dynnr
          field_name          = p_fname
      STATIC              = ' '
        mask                = '*.XLS'
        CHANGING
          file_name           = p_fname
    EXCEPTIONS
       mask_too_long       = 1
       OTHERS              = 2
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " get_filename
    *&      Form  upload_file
          text
    -->  p1        text
    <--  p2        text
    FORM upload_file.
      DATA : frow VALUE 2 TYPE i,
             fcol VALUE 1 TYPE i,
             erow VALUE 10000 TYPE i,
             ecol VALUE 7  TYPE i,
             ecol1 VALUE 1 TYPE i,
             c_col1 TYPE i VALUE '0001',
             c_col2 TYPE i VALUE '0002',
             c_col3 TYPE i VALUE '0003',
           &nb! sp; c_col4 TYPE i VALUE '0004',
             c_col5 TYPE i VALUE '0005',
             c_col6 TYPE i VALUE '0006',
             c_col7 TYPE i VALUE '0007'.
    ***FM used to UPLOAD data from Flat file
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_fname
                i_begin_col             = fcol
                i_begin_row             = frow
                i_end_col               = ecol
                i_end_row               = erow
           TABLES
                intern                  = t_xls_file
           EXCEPTIONS
                inconsistent_parameters = 1
                upload_ole              = 2
                OTHERS                  = 3.
      IF sy-subrc <> 0.
        MESSAGE e000.
      ENDIF.
    ****T_XLS_FILE is initial, stop the process & throw message
      IF t_xls_file[] IS INITIAL.
        FORMAT COLOR 6 ON INTENSIFIED ON.
        WRITE:/ 'No Data  Exists '.
        FORMAT COLOR OFF INTENSIFIED OFF.
        STOP.
      ELSE.
    Sort table by rows and colums
        SORT t_xls_file BY row col.
    Get first row retrieved
        READ TABLE t_xls_file INDEX 1.
    Set first row retrieved to current row
        v_currentrow = t_xls_file-row.
    **Loop  to move data in internal Table
        LOOP AT t_xls_file .
      Reset values for next row
          IF t_xls_file-row NE v_currentrow.
            APPEND wa_header TO t_header.
            CLEAR wa_header.
            v_currentrow = t_xls_file-row.
          ENDIF.
          CASE t_xls_file-col.
            WHEN  c_col1.                              "Kschl
              wa_header-kschl = t_xls_file-value.
            WHEN c_col2.                              "Vkorg
              wa_header-vkorg = t_xls_file-value.
            WHEN c_col3.                              "vtweg
              wa_header-vtweg = t_xls_file-value.
            WHEN c_col4.                              "Matnr
              wa_header-matnr = t_xls_file-value.
            WHEN c_col5.                              "Kbetr
              wa_header-kbetr = t_xls_file-value.
            WHEN c_col6.                              "FROm
              wa_header-datab   = t_xls_file-value.
            WHEN c_col7.                              "TO
              wa_header-datbi   = t_xls_file-value.
          ENDCASE.
        ENDLOOP.
        APPEND wa_header TO t_header.
        CLEAR wa_header.
      ENDIF.
    ****To process the data
      PERFORM f_process.
    ENDFORM.                    " upload_file
    *&      Form  READ_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM read_data.
    ****To make Uniq Records in Header Level
      SORT t_header BY kschl vkorg vtweg.
      DELETE ADJACENT DUPLICATES FROM t_header COMPARING
                                       kschl vkorg vtweg .
      SORT t_item BY vkorg vtweg matnr.
      DATA : wa1_item TYPE type_item.
      DATA : l_cnt TYPE i.
      DATA : flag(1) TYPE c. "to process the Line item.
    ***Looping Header Table.
      LOOP AT t_header INTO wa_header.
        PERFORM bdc_dynpro      US! ING 'SAPMV13A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV13A-KSCHL'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=ANTA'.
        PERFORM bdc_field       USING 'RV13A-KSCHL'
                                      wa_header-kschl.
        PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'RV130-SELKZ(03)'.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                      '=WEIT'.
        PERFORM bdc_field       USING 'RV130-SELKZ(03)'
                                      'X'.
        PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
        PERFORM bdc_field       USING 'BDC_CURSOR'
                                      'KOMG-VKORG'.
        PERFORM bdc_field       USING 'KOMG-VKORG'
                                       wa_header-vkorg.
        PERFORM bdc_field       USING 'KOMG-VTWEG'
                                       wa_header-vtweg.
    ****To handle Line Items.
        LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
                                      vtweg = wa_header-vtweg.
          wa_item = wa1_item.
    ******Flag Set only After processing  first 14 records .
          IF flag = ' '.
            v_lindx  = v_lindx + 01.
            SHIFT  v_lindx LEFT DELETING LEADING '0'.
            v_item  = v_lindx .
            CONCATENATE 'KOMG-MATNR(' v_item ')'  INTO v_matnr.
            PERFORM bdc_field           USING v_matnr
                                          wa_item-matnr.
            CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
            PERFORM bdc_field       USING v_kbetr
                                          wa_item-kbetr.
            CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
            PERFORM bdc_field       USING  v_dat
                                          wa_item-datab.
            CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
            PERFORM bdc_field       USING  v_dat1
                                          wa_item-datbi.
            IF  v_item = 14.
              flag = 'X'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                  '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
              PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
              CLEAR v_lindx.
              CLEAR v_item.
              CONTINUE.
            ENDIF.
          ENDIF.
    ***Flag is Set  after Processing of 14 records.
    TO process rest of Records
          IF flag = 'X'.
            v_pgedwn2  = v_pgedwn2 + 1.
            v_lindx1  = v_lindx1 + 01.
            SHIFT  v_lindx1 LEFT DE! LETING LEADING '0'.
            v_item  = v_lindx1 .
            CONCATENATE 'KOMG-MATNR(' v_it! em ')'  INTO v_matnr.
            PERFORM bdc_field           USING v_matnr
                                          wa_item-matnr.
            CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
            PERFORM bdc_field       USING v_kbetr
                                          wa_item-kbetr.
            CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
            PERFORM bdc_field       USING  v_dat
                                          wa_item-datab.
            CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
            PERFORM bdc_field       USING  v_dat1
                                          wa_item-datbi.
            IF v_pgedwn2 = 13.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                  '/00'.
              PERFORM bdc_field       USING 'BDC_OKCODE'
                                                 '=P+'.
              PERFORM bdc_dynpro      USING 'SAPMV13A' '1004'.
              v_pgedwn2 = 0.
              v_lindx1 = 1.
              CLEAR v_item.
              CONTINUE.
            ENDIF.
          ENDIF.
        ENDLOOP.
        PERFORM bdc_field       USING 'BDC_OKCODE'
                                   '=SICH'.
    Calling Transaction after Processing All items.
        CALL TRANSACTION 'VK11' USING bdctab
                           OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
        REFRESH bdctab.
        CLEAR : bdctab.
        CLEAR : wa_item.
        CLEAR : wa1_item.
        CLEAR : wa_header.
        CLEAR : l_cnt.
        CLEAR : v_lindx1.
        CLEAR:  v_pgedwn2,v_lindx.
        LOOP AT tmess_mtab .
          l_cnt =  l_cnt + 1.
          READ TABLE t_item INTO wa_item INDEX l_cnt .
          CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
               EXPORTING
                    arbgb             = tmess_mtab-msgid
                    msgnr             = tmess_mtab-msgnr
                    msgv1             = tmess_mtab-msgv1
                    msgv2             = tmess_mtab-msgv2
                    msgv3             = tmess_mtab-msgv3
                    msgv4           !   = tmess_mtab-msgv4
               IMPORTING
                    msgtext           = wa_mtab-text
               EXCEPTIONS
                    message_not_found = 1
                    OTHERS            = 2.
          IF sy-subrc <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          wa_mtab-matnr   = wa_item-matnr.
          wa_mtab-msgtyp  = tmess_mtab-msgtyp.
          wa_mtab-msgid   = tmess_mtab-msgid.
          wa_mtab-msgn! r   = tmess_mtab-msgnr.
          APPEND wa_mtab TO t_mtab.
          CLEAR wa_mtab-text.
          CLEAR wa_item.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    " READ_DATA
    *&      Form  BDC_DYNPRO
          text
         -->P_0300   text
         -->P_0301   text
           Start new screen                                              *
    FORM bdc_dynpro USING program dynpro.
      CLEAR bdctab.
      bdctab-program  = program.
      bdctab-dynpro   = dynpro.
      bdctab-dynbegin = 'X'.
      APPEND bdctab.
    ENDFORM.                    " BDC_DYNPRO
    *&      Form  BDC_FIELD
          text
         -->P_0305   text
         -->P_WA_HEADER_KSCHL  text
           Insert field                                                  *
    FORM bdc_field USING fnam fval.
      CLEAR bdctab.
      bdctab-fnam = fnam.
      bdctab-fval = fval.
      APPEND bdctab.
    ENDFORM.                    " BDC_FIELD
    *&      Form  bdc_trc_ansaction
          text
         -->P_0527   text
    *&      Form  f_Process
          text
    -->  p1        text
    <--  p2        text
    FORM f_process.
      DATA : l_todate(12) TYPE c,
             l_frdate(12) TYPE c.
    ***Select for all entries of material in Header "Flat File Materials".
      IF NOT t_header[] IS INITIAL.
       SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
                               IN t_header WHERE matnr = t_header-matnr AND
                                                 vkorg = t_header-vkorg AND
                                                     vtweg = t_header-vtweg.
      ENDIF.
    *********select Sales.org & Dist.channel.
      IF NOT t_header[] IS INITIAL.
        SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
                                    t_header WHERE vkorg = t_header-vkorg
                                               AND vtweg = t_header-vtweg.
      ENDIF.
    ***Checking for material in Sales Master Table
      SORT t_mvke BY matnr vkorg vtweg.
      SORT t_tvkov BY vkorg vtweg.
      LOOP AT t_header INTO wa_header.
        READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
                                                 vkorg = wa_header-vkorg
                                    ! ;  vtweg = wa_header-vtweg BINARY SEARCH.
        IF sy-subrc <> 0.
          wa_error = wa_header.
        &nb! sp; MOVE text-011 TO  wa_error-text.
          APPEND wa_error TO t_error.
          DELETE TABLE t_header FROM wa_header.
        ELSE.
    ********Date Validations
          IF ( wa_header-datab  NE ' ! ;  '  AND  wa_header-datbi NE  '  ' ) .
            l_todate = wa_header-datab.
            l_frdate = wa_header-datbi.
            REPLACE '.' INTO l_toda! te WITH ''.
            REPLACE '.' INTO l_todate WITH ''.
            CONDENSE l_todate NO-GAPS.
            REPLACE '.' INTO l_frdate WITH ''.
            REPLACE '.' INTO l_frdate WITH ''.
            CONDENSE l_frdate NO-GAPS.
            IF l_frdate < l_todate.
              wa_error = wa_header .
              MOVE text-012 TO wa_error-text.
              APPEND wa_error TO t_error.
              DELETE TABLE t_header FROM wa_header.
            ENDIF.
          ELSE.
            wa_error = wa_header .
            MOVE text-016 TO wa_error-text.
            APPEND wa_error TO t_error.
            DELETE TABLE t_header FROM wa_header.
          ENDIF.
        ENDIF.
    ********Rate Validation.
        IF wa_header-kbetr = '   '.
          wa_error = wa_header .
          MOVE text-017 TO wa_error-text.
          APPEND wa_error TO t_error.
          DELETE TABLE t_header FROM wa_header.
        ENDIF.
        READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
                                                   BINARY SEARCH.
        IF sy-subrc  = 0.
          READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
                                                       BINARY SEARCH.
          IF sy-subrc  <> 0.
            wa_error = wa_header.
            MOVE text-015 TO  wa_error-text.
            WRITE wa_header-vtweg TO wa_error-text+13(4).
            APPEND wa_error TO t_error.
          ENDIF.
        ELSE.
          wa_error = wa_header.
          MOVE text-013 TO  wa_error-text.
          WRITE wa_header-vkorg TO wa_error-text+9(4).
          APPEND wa_error TO t_error.
        ENDIF.
        CLEAR wa_header.
      ENDLOOP.
    *****Deleting Duplicate Material  Form Header "Flat File Data".
      SORT t_header BY kschl vkorg vtweg matnr.
      DELETE ADJACENT DUPLICATES FROM t_header COMPARING
            kschl! vkorg vtweg matnr .
    ****Data Moving from Header to Item Level.
      t_item[] = t_header[].
    *To count No.of records in Item Table.
      DESCRIBE TABLE t_item  LINES v_count.
      CONCATENATE text-014 ' ' v_count INTO  v_bdc.
    ****Popup to get Confirmation from user to process BDC
      CALL FUNCTION 'POPUP_TO_CONFIRM'
           EXPORTING
                titlebar       = 'Confirmation of File Data'
                text_question  = v_bdc
                text_button_1  = 'Confirm'
                text_button_2  = 'Cancel Run'
                default_button = '1'
           IMPORTING
                answer         = c_ans.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-! MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " f_Process
    *&      Form  f_Refresh
          text
    -->  p1        text
    <--  p2        text
    FORM f_refresh.
      REFRESH :  t_xls_file,
                 t_header,
                 t_item,
                 t_mvke,
                 t_tvkov,
                 t_error,
                 t_mtab.
      CLEAR :    t_xls_file,
                 wa_header,
                 wa_item,
                 wa_mvke,
                 wa_tvkov,
                 wa_error,
                 wa_mtab.
    ENDFORM.                    " f_Refresh
    Regards

  • Calling second transaction from a bdc prg

    Hi experts
    I am using a prog for ISU-Transaction EG33 now my requirement is I have to call another transaction IL02 within this transaction my requirement is just to  tick a check box.
    Another thing here after executing my current prg ( eg33)  function location is created after completion of transction ....the same function location need to be used in my second transaction for which whom i am gonna tick tat check box.(single installation)
    thanks in advance
    any ideas ???

    hi,
    u can have a look at this code
    *& Report  ZFIC_BDC_F_43_02_ADJ
    REPORT  zfic_bdc_f_43_02_adj MESSAGE-ID zfi NO STANDARD PAGE HEADING .
    DATA : t_excel   LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE,
           v_mvar1      LIKE balm-msgv1,
           v_mtext(100) TYPE c,
           v_tabix(4)   TYPE c ,
           t_bdcdata     LIKE bdcdata        OCCURS 0 WITH HEADER LINE.
    ----declaration of internal table for uploading the excel file -
    DATA: BEGIN OF itab OCCURS 0 ,
          bukrs LIKE bkpf-bukrs,
            blart LIKE bkpf-blart,
            bldat(10) TYPE c ,
            budat(10) TYPE c ,
            monat LIKE bkpf-monat,
            waers LIKE bkpf-waers,
            docid LIKE fs006-docid,
            newbs LIKE rf05a-newbs,
            newko LIKE rf05a-newko,
           mwskz LIKE bseg-mwskz,
           wrbtr LIKE bseg-wrbtr,
            zuonr LIKE bseg-zuonr,
            sgtxt LIKE bseg-sgtxt,
            zfbdt(10) TYPE c ,
            prctr LIKE cobl-prctr,
           bukrs1 TYPE bkpf-bukrs,
            blart1 TYPE bkpf-blart,
            bldat1(10) TYPE c ,
            budat1(10) TYPE c ,
            monat1 TYPE bkpf-monat,
            waers1 TYPE bkpf-waers,
            newbs1 LIKE rf05a-newbs,
            newko1 LIKE rf05a-newko,
            newum LIKE rf05a-newum,
            wrbtr1(16) TYPE c,
            zuonr1 LIKE bseg-zuonr,
            sgtxt1 LIKE bseg-sgtxt,
            zfbdt1(10) TYPE c ,
            bupla1 LIKE bseg-bupla,
            secco1 LIKE bseg-secco,
            prctr1 LIKE bseg-prctr,
            docid1 LIKE fs006-docid,
            wrbtr(16) TYPE c ,
            newbs2 LIKE rf05a-newbs ,
            newbs3 LIKE rf05a-newbs ,
            END OF itab.
    DATA: BEGIN OF messtab  OCCURS 0 .
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: row TYPE i,
           key(30),
          END OF messtab.
    DATA: BEGIN OF messtab2 OCCURS 0,
            mtype      LIKE bdcmsgcoll-msgtyp,
            mtext(100) TYPE c,
            row        TYPE i,
            key(30)    TYPE c,
          END OF messtab2.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : p_pfile(128) TYPE c OBLIGATORY,
                p_pbrow      TYPE i OBLIGATORY,
                p_perow      TYPE i OBLIGATORY,
                p_pdis       LIKE ctu_params-dismode OBLIGATORY DEFAULT
    'A'.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pfile .
      CALL FUNCTION 'F4_FILENAME'
       EXPORTING
         program_name        = syst-cprog
         dynpro_number       = syst-dynnr
      FIELD_NAME          = ' '
       IMPORTING
         file_name           = p_pfile .
    START-OF-SELECTION .
    ----uploading the excel file to internal table -
      PERFORM upload_file .
    -----filling the bdc table -
      PERFORM fill_bdctable .
    ------writing the error log -
      PERFORM write_messtab .
    *&      Form  UPLOAD_FILE
          text
    -->  p1        text
    <--  p2        text
    FORM upload_file .
      CLEAR : t_excel .
      REFRESH : t_excel .
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_pfile
          i_begin_col             = '1'
          i_begin_row             = p_pbrow
          i_end_col               = '27'
          i_end_row               = p_perow
        TABLES
          intern                  = t_excel
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH text-002.
      ENDIF.
      LOOP AT t_excel .
        CASE t_excel-col .
          WHEN '001'.
            itab-bldat = t_excel-value.
          WHEN '002'.
            itab-budat = t_excel-value.
          WHEN '003'.
            itab-blart = t_excel-value.
          WHEN '004'.
            itab-bukrs = t_excel-value.
          WHEN '005'.
            itab-monat = t_excel-value.
          WHEN '006'.
            itab-waers = t_excel-value.
          WHEN '007'.
            itab-docid = t_excel-value.
          WHEN '008'.
            itab-newbs = t_excel-value.
          WHEN '009'.
            itab-newko = t_excel-value.
          WHEN '010'.
            itab-wrbtr = t_excel-value.
          WHEN '011'.
            itab-bupla1 = itab-bukrs.
            itab-secco1 = itab-bukrs.
            itab-zfbdt = t_excel-value.
          WHEN '012'.
            itab-zuonr = t_excel-value.
          WHEN '013'.
            itab-sgtxt = t_excel-value.
          WHEN '014'.
            itab-newbs1 = t_excel-value.
          WHEN '015'.
            itab-newko1 = t_excel-value.
          WHEN '016'.
            itab-prctr = t_excel-value .
          WHEN '017'.
            itab-wrbtr = t_excel-value .
          WHEN '018'.
            itab-bldat1 = t_excel-value.
          WHEN '019'.
            itab-budat1 = t_excel-value.
          WHEN '020'.
            itab-blart1 = t_excel-value.
          WHEN '021'.
            itab-monat1 = t_excel-value.
          WHEN '022'.
            itab-newbs2 = t_excel-value.
          WHEN '023'.
            itab-wrbtr1 = t_excel-value.
          WHEN '024'.
            itab-zuonr1 = t_excel-value.
          WHEN '025'.
            itab-sgtxt1 = t_excel-value.
          WHEN '026'.
            itab-newbs3 = t_excel-value.
          WHEN '027'.
            itab-newum = t_excel-value .
            AT END OF row .
              APPEND itab.
              CLEAR itab .
            ENDAT.
        ENDCASE .
      ENDLOOP.
    ENDFORM.                    " UPLOAD_FILE
    *&      Form  fill_bdctable
          text
    -->  p1        text
    <--  p2        text
    FORM fill_bdctable .
      LOOP AT itab .
        v_tabix = sy-tabix .
        PERFORM bdc_dynpro USING :
          '1'  'SAPMF05A'      '0100',
          ' '  'BDC_CURSOR'    'FS006-DOCID',
          ' '  'BDC_OKCODE'    '/00',
          ' '  'BKPF-BLDAT'    itab-bldat,
          ' '  'BKPF-BLART'    itab-blart,
          ' '  'BKPF-BUKRS'    itab-bukrs,
          ' '  'BKPF-BUDAT'    itab-budat,
          ' '  'BKPF-MONAT'    itab-monat,
          ' '  'BKPF-WAERS'    itab-waers,
          ' '  'FS006-DOCID'    itab-docid,
          ' '  'RF05A-NEWBS'   itab-newbs,
          ' '  'RF05A-NEWKO'   itab-newko,
          '1'  'SAPMF05A'      '0302',
          ' '  'BDC_CURSOR'    'RF05A-NEWKO',
          ' '  'BDC_OKCODE'    '/00',
          ' '  'BSEG-WRBTR'    itab-wrbtr,
    ' '  'BSEG-MWSKZ'    ITAB-MWSKZ,
          ' '  'BSEG-ZFBDT'    itab-zfbdt,
          ' '  'BSEG-ZUONR'    itab-zuonr,
          ' '  'BSEG-SGTXT'    itab-sgtxt,
          ' '  'RF05A-NEWBS'   itab-newbs1,
          ' '  'RF05A-NEWKO'   itab-newko1,
          '1'  'SAPMF05A'      '0300',
          ' '  'BDC_CURSOR'    'BSEG-WRBTR',
          ' '  'BDC_OKCODE'    '/00',
          ' '  'BSEG-WRBTR'    itab-wrbtr,
          '1'  'SAPLKACB'      '0002',
          ' '  'BDC_CURSOR'    'COBL-PRCTR',
          ' '  'BDC_OKCODE'    '=ENTE',
          ' '  'COBL-PRCTR'    itab-prctr,
          '1'  'SAPMF05A'      '0300',
          ' '  'BDC_CURSOR'    'BSEG-WRBTR',
          ' '  'BDC_OKCODE'    '=BS',
          ' '  'BSEG-WRBTR'    itab-wrbtr,
          '1'  'SAPLKACB'      '0002',
          ' '  'BDC_CURSOR'    'COBL-PRCTR',
          ' '  'BDC_OKCODE'    '=ENTE',
          ' '  'COBL-PRCTR'    itab-prctr,
          '1'  'SAPMF05A'      '0700',
         ' '  'BDC_CURSOR'    'RF05A-NEWBS',
          ' '  'BDC_OKCODE'     '=BU'.
        CALL TRANSACTION 'F-43' USING  t_bdcdata
                                  MODE   p_pdis
                                  UPDATE 'A' MESSAGES INTO messtab.
        LOOP AT messtab WHERE msgtyp = 'E' .
          v_mvar1 = messtab-msgv1+0(49).
          CALL FUNCTION 'MESSAGE_PREPARE'
          EXPORTING
          language = sy-langu
          msg_id   = messtab-msgid
          msg_no   = messtab-msgnr
          msg_var1 = v_mvar1
    MSG_VAR2 = ' '
    MSG_VAR3 = ' '
    MSG_VAR4 = ' '
          IMPORTING
          msg_text = v_mtext
          EXCEPTIONS
          function_not_completed = 1
          message_not_found = 2
          OTHERS = 3 .
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          messtab-row = p_pbrow + v_tabix - 1.
          messtab-key = itab-newbs.
          messtab2-row = messtab-row.
          messtab2-key = messtab-key.
          messtab2-mtype = messtab-msgtyp.
          messtab2-mtext = v_mtext.
          APPEND messtab2.
          CLEAR messtab.
        ENDLOOP.
        REFRESH t_bdcdata .
        PERFORM bdc_dynpro USING :
      '1'  'SAPMF05A'      '0100',
      ' '  'BDC_CURSOR'    'RF05A-NEWKO',
      ' '  'BDC_OKCODE'    '/00',
      ' '  'BKPF-BLDAT'    itab-bldat1,
      ' '  'BKPF-BLART'    itab-blart1,
      ' '  'BKPF-BUKRS'    itab-bukrs,
      ' '  'BKPF-BUDAT'    itab-budat1,
      ' '  'BKPF-MONAT'    itab-monat1,
      ' '  'BKPF-WAERS'    itab-waers,
      ' '  'FS006-DOCID'   itab-docid1,
      ' '  'RF05A-NEWBS'   itab-newbs2,
      ' '  'RF05A-NEWKO'   itab-newko,
      '1'  'SAPMF05A'      '0302',
      ' '  'BDC_CURSOR'    'RF05A-NEWUM',
      ' '  'BDC_OKCODE'    '/00',
      ' '  'BSEG-WRBTR'    itab-wrbtr1,
      ' '  'BSEG-ZFBDT'    itab-zfbdt,
      ' '  'BSEG-SGTXT'    itab-sgtxt1,
      ' '  'RF05A-NEWBS'   itab-newbs3,
      ' '  'RF05A-NEWKO'   itab-newko,
      ' '  'RF05A-NEWUM'   itab-newum,
      '1'  'SAPMF05A'      '0304',
      ' '  'BDC_CURSOR'    'BSEG-PRCTR',
      ' '  'BDC_OKCODE'    '/00',
      ' '  'BSEG-WRBTR'    itab-wrbtr1,
      ' '  'BSEG-PRCTR'    itab-prctr,
      ' '  'BSEG-ZUONR'    itab-zuonr1,
      ' '  'BSEG-SGTXT'    itab-sgtxt1,
      ' '  'BSEG-BUPLA'    itab-bukrs,
      ' '  'BSEG-SECCO'    itab-bukrs,
       '1' 'SAPMF05A'      '0304',
      ' '  'BDC_CURSOR'    'BSEG-WRBTR',
      ' '  'BDC_OKCODE'    '=BS',
      ' '  'BSEG-WRBTR'    itab-wrbtr1,
      ' '  'BSEG-BUPLA'    itab-bukrs,
      ' '  'BSEG-SECCO'    itab-bukrs,
      ' '  'BSEG-PRCTR'    itab-prctr,
      ' '  'BSEG-ZUONR'    itab-zuonr1,
      ' '  'BSEG-SGTXT'    itab-sgtxt1,
      '1'  'SAPMF05A'      '0700',
      ' '  'BDC_CURSOR'    'RF05A-NEWBS',
      ' '  'BDC_OKCODE'    '=BU'.
        CALL TRANSACTION 'F-02' USING  t_bdcdata
                                  MODE   p_pdis
                                  UPDATE 'A' MESSAGES INTO messtab.
        APPEND messtab.
        REFRESH t_bdcdata .
      ENDLOOP .
    ENDFORM.                    " fill_bdctable
    *&      Form  BDC_DYNPRO
          text
         -->P_0337   text
         -->P_0338   text
         -->P_0339   text
    FORM bdc_dynpro  USING    flag
                              var1
                              var2.
      CLEAR t_bdcdata .
      IF flag = 1.
        t_bdcdata-program     = var1.
        t_bdcdata-dynpro      = var2.
        t_bdcdata-dynbegin    = 'X'.
      ELSE.
        t_bdcdata-fnam        = var1.
        t_bdcdata-fval        = var2.
      ENDIF.
      APPEND t_bdcdata.
    ENDFORM.                    " BDC_DYNPRO

Maybe you are looking for