BDC for CO02 , How to check conditions

Hi,
i m trying a BDC of CO02- Change Production Order, i have recorded the transaction by changing the date field in the first screen and then by pressing "Operation Overview" button to change the "WorkCenter".
The Workcenter screen holds the value in the table control.
After recording , when i pass value from TXT file, the BDC Program should identify the table control row which is having AFVGD-KTSCH's Value as 'SEWING', so that the value from the TXT file should replace the another field AFVGD-ARBPL based on the stdtext-'SEWING'.
can any body help me in this.

dear prabhu,
see the below code, suggest me where to do the checking,
see the BOLD part of the mail for more info.
pls help in this, i m new to BDC.
regs,
raja
data: str type c length 1,
var type c length 30,
cntr type i.
data: begin of record,
  AUFNR(012),
  FLG_OVIEW(001),
  GLTRP(010),
  GSTRP(010),
  ARBPL(008),
  KTSCH(020),
end of record.
DATA: itab LIKE record OCCURS 1000 WITH HEADER LINE.
PARAMETERS textfile LIKE rlgrap-filename DEFAULT
'c:\prdord.txt'.
End generated data section ***
START-OF-SELECTION.
  CALL FUNCTION 'WS_UPLOAD'
    EXPORTING
      filename            = textfile
      filetype            = 'DAT'
    TABLES
      data_tab            = itab
    EXCEPTIONS
      conversion_error    = 1
      file_open_error     = 2
      file_read_error     = 3
      invalid_type        = 4
      no_batch            = 5
      unknown_error       = 6
      invalid_table_width = 7
      OTHERS              = 8.
  IF sy-subrc <> 0.
    WRITE:/ 'Upload From',textfile,'to itab is not successful'.
    EXIT.
  ENDIF.
  LOOP AT itab.
IF sy-subrc <> 0. EXIT. ENDIF.
perform bdc_dynpro      using 'SAPLCOKO1' '0110'.
perform bdc_field       using 'BDC_CURSOR'
                              'CAUFVD-AUFNR'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'CAUFVD-AUFNR'
                              itab-AUFNR.
perform bdc_field       using 'R62CLORD-FLG_OVIEW'
                              itab-FLG_OVIEW.
perform bdc_dynpro      using 'SAPLCOKO1' '0115'.
perform bdc_field       using 'BDC_OKCODE'
                              '=TERM'.
perform bdc_field       using 'BDC_CURSOR'
                              'CAUFVD-GSTRP'.
perform bdc_field       using 'CAUFVD-GLTRP'
                              itab-GLTRP.
perform bdc_field       using 'CAUFVD-GSTRP'
                              itab-GSTRP.
perform bdc_dynpro      using 'SAPLCOKO1' '0115'.
perform bdc_field       using 'BDC_OKCODE'
                              '=VGUE'.
perform bdc_field       using 'BDC_CURSOR'
                              'CAUFVD-GAMNG'.
perform bdc_field       using 'CAUFVD-GSTRP'
                              itab-GSTRP.
perform bdc_dynpro      using 'SAPLCOVG' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'AFVGD-KTSCH'.
<b>Here is where i need to check whether the 'AFVGD-KTSCH'containing value 'SEWING' then the itab value should be placed in the below  screen-field.</b>
  perform bdc_field       using 'BDC_CURSOR'
                              'AFVGD-ARBPL(02)'.
  perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
  perform bdc_field       using 'AFVGD-ARBPL(02)'
                              itab-ARBPL.
  perform bdc_dynpro      using 'SAPLCOVG' '0100'.
  perform bdc_field       using 'BDC_OKCODE'
                              '=FREI'.
  perform bdc_field       using 'BDC_CURSOR'
                              'PSFC_DISP-AUFNR'.
perform bdc_dynpro      using 'SAPLSPO2' '0300'.
perform bdc_field       using 'BDC_OKCODE'
                              '=OPT1'.
perform bdc_dynpro      using 'SAPLCOVG' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              '=BU'.
perform bdc_field       using 'BDC_CURSOR'
                              'PSFC_DISP-AUFNR'.
CALL TRANSACTION 'CO02' USING bdcdata MODE 'A'.
if sy-subrc eq 1001.
write:/ ITAB-aufnr,ITAB-arbpl, ITAB-gstrp.
write 'Not Updated'.
else.
write:/ ITAB-aufnr,ITAB-arbpl, ITAB-gstrp.
write 'Updated Successfully'.
endif.
REFRESH bdcdata.
*else.
write 'Improper Text File Format'.
*endif.
endloop.

Similar Messages

  • How to update Ztable from Excel file and how to check conditions ,

    HI this uday,
    pls help me how can i update Ztable from Excel file and how to check conditions .
    regards
    uday
    Moderator message: please (re)search yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 12:00 PM

    Hi
    Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.
    L_INTERN : internal table with your fields .
    make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .
    LOOP AT L_INTERN INTO WA_LINTERN .
            MOVE WA_LINTERN-COL TO L_INDEX.
            ASSIGN COMPONENT  L_INDEX OF STRUCTURE WA_INREC TO <FS> .
            IF SY-SUBRC = 0.
              MOVE WA_LINTERN-VALUE TO <FS>.
            ENDIF.
            AT END OF  ROW .                                    "#EC *
              APPEND WA_INREC TO IT_DATA.  "
              CLEAR WA_INREC.
            ENDAT.
         ENDLOOP.
    Regards
    Swapnil

  • Regarding BDC for CO02

    Hi All,
    Iam facing a peculiar problem in BDC for CO02  for Collective orders. While recording, I have captured the ok_code for the Push button 'Read Order' . But while processing it , it stops exactly after displaying the list. Here I need to click manually on 'Read Order' to continue the processing. I think the problem comes because the list displayed is a ALV tree.Can anybody please suggest a solution if they faced it earlier.
    Please let me know if you need any details. Points will be rewarded to the useful answers.
    Thanks,
    Manjula.S

    HI Manjula
    I am facing a similar kind of issue to process the BDC for tree sture
    Please advice

  • Urgent,need for code in bdc for co02

    hi all,
    im in urgent need of code for developing bdc tcode co02.
    Thanks for your help..

    1. Please record the transaction which you need to change the data in Co02 (Shop Order/Prod. Order)
    2. Create BDC program as normally you do it for normal BDC programs..
    Smaple Code with Recording.
    clear: bdcdata,messtab.
      perform bdc_dynpro using: 'SAPLCOKO1' '0110'.
      perform bdc_field using: 'CAUFVD-AUFNR' t_aufk-aufnr.
      perform bdc_field using: 'R62CLORD-FLG_OVIEW' 'X'.
      perform bdc_field using: 'BDC_OKCODE' '/00'.
      perform bdc_dynpro using: 'SAPLCOKO1' '0115'.
      perform bdc_field using: 'BDC_SUBSCR' 'SAPLCOKO1'.
      perform bdc_field using: 'BDC_OKCODE' '=KOWE'.
      perform bdc_dynpro using: 'SAPLCOKO1' '0115'.
      perform bdc_field using: 'BDC_SUBSCR' 'SAPLCOKO1'.
      perform bdc_field using: 'BDC_CURSOR' 'AFPOD-INSMK'.
       perform bdc_field using: 'AFPOD-INSMK' 'S'.
      perform bdc_field using: 'BDC_OKCODE' '=BU'.
      call transaction 'CO02' using bdcdata mode 'A'
                                            update 'S'
                                            messages into messtab.
    Thanks,

  • User Exit for CO01/CO02 : How to check production order before saving ?

    Hi all,
    I try to check production order before saving.
    if  AFPO-LGORT or RESB-LGORT  or some other field is initial, throw an error msg and stop saving process.
    I try using badi WORKORDER_UPDATE and user exit PPCO0001  EXIT_SAPLCOBT_001, find out that i can check the data but can't stop the saving process.
    Anyone knows some other user exits can do this?
    Thanks a lot.

    Solved.
    A wired solution from
    http://abaplog.wordpress.com/2007/03/01/reading-other-programs-data-using-field-symbols-in-abap/

  • BDC- for IW51 - How to change tabstrip

    Hi,
    I am new to BDC. Creating one for IW51.
    Here, in next tabstrip - (Additions data 1) I need to add ' Coding' .
    I tried but Notification is Saved (First page), but without coding field.
    How to do it?

    I did it - Using SM35
      51     SAPLIQS0     7200     X                                                                               
    52                                                                 BDC_OKCODE     =10\TAB02
      53                                                                 BDC_SUBSCR     SAPLIQS0                                1060SCREEN_1
      54                                                                 VIQMEL-QMTXT     I&C AT,ALEMBIC LIMITED,BARODA
      55                                                                 BDC_SUBSCR     SAPLQM07                                3000ACTION-BOX
      56                                                                 BDC_SUBSCR     SAPLIQS0                                7235SUB_GROUP_10
      57                                                                 BDC_SUBSCR     SAPLIQS0                                7212CUSTOM_SCREEN
      58                                                                 BDC_SUBSCR     SAPLIQS0                                7515SUBSCREEN_1
      59                                                                 VIQMEL-QMDAT     02.08.2010
      60                                                                 VIQMEL-MZEIT     15:15:59
      61                                                                 VIQMEL-BSTNK     HPP/291188
      62                                                                 VIQMEL-BSTDK     04.03.2010
      63                                                                 BDC_SUBSCR     SAPLIPAR                                0700ANSPRECH
      64                                                                 BDC_SUBSCR     SAPLIPAR                                0130TSTRIP_SCREEN
      65                                                                 BDC_SUBSCR     SAPLIPAR                                0150ADRESSE
      66                                                                 VIQMEL-KUNUM     700023
      67                                                                 BDC_SUBSCR     SAPLIPAR                                0120ANSCHRIFT
      68                                                                 BDC_SUBSCR     SAPLIPAR                                0160BUTTONS
      69                                                                 BDC_SUBSCR     SAPLIQS0                                7322SUBSCREEN_2
      70                                                                 BDC_SUBSCR     SAPLIWO1                                1200OBJEKT
      71                                                                 RIWO1-EQUNR     1000047274
      72                                                                 RIWO1-SERIALNR     309US5921003
      73                                                                 RIWO1-MATNR     US5921
      74                                                                 RIWO1-DEVICEID     0910/1299
      75                                                                 BDC_SUBSCR     SAPLIQS0                                7520SUBSCREEN_3
      76                                                                 VIQMEL-MAUEH     H
      77                                                                 VIQMEL-STRMN     02.08.2010
      78                                                                 VIQMEL-STRUR     15:15:59
      79                                                                 VIQMEL-LTRMN     09.08.2010
      80                                                                 VIQMEL-LTRUR     00:00:00
      81                                                                 VIQMEL-AUSVN     02.08.2010
      82                                                                 VIQMEL-AUZTV     15:16:00
      83                                                                 VIQMEL-AUZTB     00:00:00
      84                                                                 RIWO00-GEWRK     WCSSBRDA
      85                                                                 RIWO00-SWERK     4000
      86                                                                 VIQMEL-IWERK     4000
      87                                                                 VIQMEL-VKORG     1000
      88                                                                 VIQMEL-VTWEG     10
      89                                                                 VIQMEL-SPART     UP
      90                                                                 VIQMEL-VKBUR     VAD
      91                                                                 VIQMEL-VKGRP     PNQ
      92                                                                 BDC_SUBSCR     SAPLIPAR                                0400INTPAR
      93                                                                 DIIHPA-I_PARNR     50000215
      94                                                                 BDC_SUBSCR     SAPLIPAR                                0450VERA
      95                                                                 BDC_CURSOR     RQM02-PARNR_VERA
      96                                                                 RQM02-PARNR_VERA     416
      97                                                                 BDC_SUBSCR     SAPLIQS0                                7324SUBSCREEN_4
      98                                                                 BDC_SUBSCR     SAPLIQS0                                6030SUBSCREEN_5

  • How to check && condition in output text

    I want to check a condition like this in output text
    <af:outputText id="t1" value = "#{empty bean.text1 && empty bean.text2 ? 'temp1' : 'temp2' " />
    It throws an error saying "Expected name instead of

    If you are editing the el expression in source tab of your jsff/jspx file use the below el:
    <af:outputText id="t1" value = "#{empty bean.text1 *&amp;&amp;* empty bean.text2 ? 'temp1' : 'temp2' " />
    If you use the el: <af:outputText id="t1" value = "#{empty bean.text1 && empty bean.text2 ? 'temp1' : 'temp2' " /> in the property inspector, then it gets converted to the above expression.
    Hope it helps.

  • Adobe reader for mac how to check installation

    Every time I try to open a PDF file on this one website I need to open the files on, it says this:
    "Before viewing PDF documents in this browser you must launch Adobe Reader and accept the End User License Agreement, then Quit and relaunch the browser."
    Okay, so I did that, and still cannot open the PDF file! I have attempted to update and launch the latest adobe reader and it is not working.  I have a Mac 10.9.5

    Adobe Reader says I didn't accept end user agreement and won't let me open on Mac.

  • How to check the row level security in TOAD for oracle

    Hi ,
    for ex, i have 2 types of users
    normal user and super user
    super user can see the group set (some column name) created by normal user
    but normal user can not see the set created by super user
    this set crestion aslso has 3 types "U','P',S'
    P & S can be viewed by even normal user
    but U should not
    so here we are having some row level security for the normal user .....
    So, in TOAD for oracle how to check that......
    Let me know if i'm not clear

    Like
    I'm the super user....
    And some records are inserted to a table by different users ('a' , 'b', etc....)
    So,if user 'a' logins then he can be able to see only the records inserted by 'a' only...
    how to see in TOAD where such type of scripts (filter conditions) are written.....

  • How to check the SAI REST service is working ?

    Hi All,
    Please find the below link and give me some solution for this
    How to check the SAI REST is working ?
    Regards,
    Gopinath

    give me some solution for thisThe other forum is the right place, not here.

  • How to give line items in flatfile while doing BDC for Table control

    Hi all,
    I am writing BDC for Multiple line items and Transaction  is : FSE5N.
    How do i give the data in the flat file. I mean how do we give the multiple line items in flat file , i.e for second line item again we have to header data or not ?
    ex:
    1015;ALL;demo;kr;INR;01;0001;3000172;100
    1015;ALL;demo;kr;INR;01;0001;3000172;200
    for first lineitem  : 3000172;100
    for 2nd line item : 3000172; 200.
    header data : 1015;ALL;demo;kr;INR;01;0001.
    Thanks in advance
    krupali

    Hii ,
    u can give in the same format as u have done in the example.
    A       B    C     D  E    F   G        H          I
    1015;ALL;demo;kr;INR;01;0001;3000172;100
    1015;ALL;demo;kr;INR;01;0001;3000172;200
    and while writing the loop u can give
    loop at it_head.
    loop at it_head where a = it_head-A and b = it_head-B ..........upto G = it_head-G.
      endloop.
    endloop.
    check this
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Neeraj

  • BADI/User Exit for Checking Conditions in TRM Transactions

    Hi  All,
    I have to check some conditions before saving the transaction FTR_CREATE. So that based on that condition it will be known that whether that transaction will save or not.  I found some BADIs, but those are particularly working for Money market and derivatives. For my Req, I need a BADI which will check conditions for both Money market and Securities.
    Exact req is, Based on Portfolio and PaymentAmount i have to restrict the transaction. Those will found in 2 tables VTBFHA and VTBFHAPO. But many BADIs doesnt contain VTBFHAPO.
    If any one working on TRM can u help me out ?

    >
    priya tavanam wrote:
    > Hi Frds,
    >
    > I am using the FTR_TR_GENERIC Badi.  In that one method is : EVT_TRANSACTION_SAVE_CHECK. In that one parameter is PI_PROXY_TRANSACTION. I want to get the attributes of Method A_TAB_CASHFLOW . That is  : A_TAB_CASHFLOW~BZBETR.
    -->whats ur code to read those values , it should be
    lt_cashflow[] = PI_PROXY_TRANSACTION->a_A_TAB_CASHFLOW [ ] ' .
    But i am unable to access this value in BADI. how access this. Can any one help me on this.

  • How to handle bdc for more than one transaction?

    how to handle bdc for more than one transaction?

    Hi srk,
    I am providing you with some references below. Hope this prove to be helpful to you.
    Method 1:
    Use one BDC_OPEN_GROUP
    Multiple BDC_INSERT 
    One BDC_CLOSE_GROUP.
    Call function BDC_OPENGROUP.
    Build BDC data and call lBDC_INSERT for transaction 1
    Build BDC data and call lBDC_INSERT for transaction 2
    Build BDC data and call lBDC_INSERT for transaction 3
    paas the tcodes to bdc_insert.
    call function BDC_CLOSE_GROUP.
    Also check this out:
    Here we need to record 2 transactions (shdb).
    Once completion of the recording. Populate the data into input internal table .
    Loop the internal table and process the 2 transactions
    like
    1. BDC_OPEN_GROUP
    2. LOOP AT ITAB
    a. Populate first transaction recording data
    and pass transaction to the BDC_INSERT_GROUP.
    BDC_INSERT_GROUP.
    b. Populate second transaction recording data
    and pass transaction to the BDC_INSERT_GROUP.
    BDC_INSERT_GROUP.
    ENDLOOP.
    3. BDC_CLOSE_GROUP
    the above info can be found at : How to use 2 transactions in BDC?
    Also check this out:
    Suppose u have created recordings for transactions 'MM01' 'XK01' and 'VA01'.
    Then do this:
    bdc_open_group.
    after this we have to fill the bdcdata structure for one transaction.here 'MM01'.
    bdc_insert.
    refresh bdcdata.
    after this we have to fill the bdcdata structure for one transaction.here 'xk01'.
    bdc_insert .
    refresh bdcdata.
    after this we have to fill the bdcdata structure for one transaction.here 'va01'.
    bdc_insert.
    bdc_close_group.
    Hope these are useful to you.
    Please reward if any of the above are useful.
    Regards,
    Kalyan

  • How to check for the variable passed to a function inside a component

    I'm trying to pass a variable to a function inside of a
    component in a conditional statement.
    How to check the existance of this variable inside the
    function so that I can use the right <CFarguments>:
    in aForm.cfm I have:
    <cfinvoke component="#application.cfcroot#.business.Order"
    method="selOrderItems"
    returnvariable="q_OrderItems"
    OrderItemAbbreviation="Min"></cfinvoke>
    <cfset MCompIDs = ValueList(q_OrderItems.OrderItemID)>
    <cfif listFind(MCompIDs,attributes.CompID)>
    <cfset isM = true>
    <cfelse>
    <cfset isM = false>
    </cfif>
    <cfinvoke component="#application.cfcroot#.business.Order"
    method="selOrderItems"
    returnvariable="q_OrderItems"
    OrderItemAbbreviation="SMEnroll"></cfinvoke>
    <cfset SM_CompIDs =
    ValueList(q_OrderItems.OrderItemID)>
    <cfif listFind(SM_CompIDs,attributes.CompID)>
    <cfset isSM = true>
    <cfelse>
    <cfset isSM = false>
    </cfif>
    <CFIF isSM>
    <cfset temppath = frmcreator.buildFrm(isSMFlag=isSM)>
    <CFELSE>
    <cfset temppath = frmcreator.buildFrm(isMFlag=isM)>
    </CFIF>
    On aFormComp.cfc where the function is,
    I checked the existance of isSMFlag this way and I got error
    saying that :
    Context validation error for tag CFARGUMENT.; The tag must be
    nested inside a CFFUNCTION tag.
    How can I properly check the existance of isSMFlag inside the
    function so I can use the right cfarguments?
    <CFFUNCTION NAME="buildFrm" access="public"
    returntype="String" output="No">
    <cfif StructKeyExists(arguments, "isSMFlag")>
    <CFARGUMENT NAME="isSMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    <cfelse>
    <CFARGUMENT NAME="isMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    </cfif>
    ........ etc
    </CFFUNCTION>

    <CFFUNCTION NAME="buildFrm" access="public"
    returntype="String"
    output="No">
    <cfif StructKeyExists(arguments, "isSMFlag")>
    <CFARGUMENT NAME="isSMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    <cfelse>
    <CFARGUMENT NAME="isMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    </cfif>
    ........ etc
    </CFFUNCTION>
    NOT this way, that is for sure.
    The <cfargument ...> tag is for defining the arguments
    a function
    accepts either optional or not, but they are not required.
    Give this a
    try to see the differences.
    test.cfc
    <cfcomponent>
    <cffunction name="a">
    <cfdump var="#arguments#">
    </cffunction>
    <cffunction name="b">
    <cfargument name="foo">
    <cfargument name="bar">
    <cfdump var="#arguments#>
    </cffunction>
    </cfcomponent>
    test.cfm
    <cfset something = createObject("component","test")>
    <cfoutput>
    #something.a("blue","green")#
    #something.b("blue","green")#
    </cfoutput>
    Not tested or debugged so watch out for typos.

  • How to check at replicat process a target conditional before add

    How to check on replicat , check on target table conditional before add data.
    Example :
    REPLICAT
      SOURCEDEFS /u01/app/oracle/ggs_2/dirdef/TABLE_SOURCE
    MAP  sourcet.table,target.table
    QUERY "SELECT A.COL3 FROM TABLE_SOURCE A, TABLE_DEST B where B.COL1=B.COL2"),
    COLMAP ( A.COL3, B,COL3);

    Thanks for you answers
    I mean someone like this :
    TARGET:  TABLE_C
    TABLE_A replicat direct to TABLE_C
    TABLE_B will replicat only if TABLE_A was replicated and have this values previus add with replicated TABLE_A
    how to check if TABLE_A was previously replicated?  is possible on Golden gate ?
    create or replace procedure oracle2.lookup_ACCOUNT(acc_code in varchar,acc_cta out number)
    as
    begin
    select count(*) into acc_cta from oracle2.TABLE_B where COLC_1 =acc_code AND COLC_2 =acc_code
    end;
    REPLICAT rload1
    USERID oracle2,PASSWORD extuser2
    SOURCEDEFS ./dirdef/defTABLE_A.def <  [TABLE_A + TABLE_B]
    DISCARDFILE ./dirrpt/rload1.dsc, PURGE
    MAP ORACLE.TABLE_A,TARGET ORACLE2.TABLE_C,&
    COLMAP(COLC_1=COLA_1,COLC_2=COLA_2,);
    MAP ORACLE.TABLE_B,TARGET ORACLE2.TABLE_C,&
    SQLEXEC (ID lookup,SPNAME oracle2.lookup_ACCOUNT , PARAMS (acc_code=TABLEA.COLA_1)),&
    FILTER (@GETVAL((lookup.acc_cta) > 0)),&
    COLMAP(COLC_3=COLB_1,COLC_4=COLB_2,);
    Thanks

Maybe you are looking for