Problem in using Split function

Hello,
I have a problem using the Split function and I can't find any solution in internet.
I'm trying to make a list of int but it seems that the Split function doesn't work.
Can you help me please ?
Here is my code :
public class Dessin
        List<Forme> dessin = new List<Forme>();
        public void Ajouter(Forme forme)
            dessin.Add(forme);
        public void Lecture()
            StreamReader monStreamReader = new StreamReader("ExempleTout.csv");
            int ligne = int.Parse(monStreamReader.ReadLine());
            while (ligne != null)
                int[] temp = ligne.Split(';');        // Error : 'int' doesn't contain a definition for 'Split'
                if (temp[0].Equals("Cercle"))
                    Cercle cercle1 = new Cercle(temp[1], temp[2], temp[3], temp[4], temp[5], temp[6], temp[7], temp[8]);
                ligne = int.Parse(monStreamReader.ReadLine());
            foreach (Cercle c in dessin)
                Console.WriteLine(c.ToString());
                Console.ReadKey();
            Console.ReadKey();
            monStreamReader.Close();
Best regards,

Split is a method of string, not int. You are looking for strings anyway, I don't know why you'd parse to an int to begin with. Try this:
string ligne = monStreamReader.ReadLine();
while (ligne != null)
string[] temp = ligne.Split(';');
if (temp[0].Equals("Cercle"))
Cercle cercle1 = new Cercle(int.Parse(temp[1]), int.Parse(temp[2]), int.Parse(temp[3]), int.Parse(temp[4]), int.Parse(temp[5]), int.Parse(temp[6]), int.Parse(temp[7]), int.Parse(temp[8]));
ligne = monStreamReader.ReadLine();
~~Bonnie DeWitt [C# MVP]
http://geek-goddess-bonnie.blogspot.com

Similar Messages

  • Problem in using aggregate functions inside case statement

    Hi All,
    I am facing problem while using aggregate functions inside case statement.
    CASE WHEN PSTYPE='S' THEN MAX(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ELSE SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) END,
    how can I achieve above requirement ? Con anyone help me.
    Thanks and Regards
    DG

    Hi All,
    Below is my query:
            SELECT
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT
            ELSE POS.PACCT || '-' || DECODE(POS.SYSTEMCODE,'GMI1','1', 'GMI2','2', 'GMI3','4', 'GMI4','3', '0') ||POS.PFIRM|| NVL(POS.POFFIC,'000') END,
            CASE WHEN p_reportid IN ('POS_RV_SN','POS_PB') THEN POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-')
            ELSE POS.PFIRM||POS.POFFIC||POS.PACCT||POS.PCUSIP||DECODE(POS.PBS,1,'+',2,'-') END,POS.SYSTEMCODE,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,POS.PEXCH||DECODE(POS.PSUBEX,'<NULL>',''),
            POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) END ,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,*SUM(DECODE(POS.PBS,1,ABS(POS.PPRTQ),0)) ,SUM(DECODE(POS.PBS,2,ABS(POS.PPRTQ),0))* ,
            POS.PCLOSE,SUM(POS.PMKVAL) ,
            TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.UBS_ID,POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER ,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,TO_CHAR(POS.BUSINESS_DATE,'YYYYMMDD'),
            POS.SOURCE_GMI_LIB,
            --DECODE(POS.SYSTEMCODE,'GMI1','euro','GMI2','namr','GMI3','aust','GMI4','asia','POWERBASE','aust','SINACOR','namr',POS.SYSTEMCODE),
            DECODE(p_reportid,'RVPOS_SING','euro','RVPOS_AUSTDOM','aust','RVPOS_AUSTEOD','euro','RVPOS_GLBLAPAC','asia','POS_RV_SN','namr','POS_PB','aust',POS.SYSTEMCODE),
            POS.RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            NULL,
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN POS.PSUBTY='S' THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL,
            NULL
            FROM POSITIONS_WRK POS LEFT OUTER JOIN
            (SELECT * FROM CDS_PRODUCTS CP INNER JOIN FUTURE_MASTER FM ON
            (CP.STRXCH=FM.ZEXCH AND CP.SFC=FM.ZFC AND CP.BUSINESS_DATE = FM.BUSINESS_DATE )) C ON POS.PCUSIP = C.SCUSIP
            AND NVL(POS.PCUSP2,'X') = NVL(C.SCUSP2,'X')
            WHERE
            POS.PEXCH NOT IN ('A1','A2','A3','B1','B3','C2','D1','H1','K1','L1','M1','M3','P1','S1')
            AND (POS.PSBCUS IS NOT NULL OR POS.PCTYM IS NOT NULL OR POS.PSTYPE ='S')
            AND POS.BUSINESS_DATE = run_date_char
            GROUP BY
            POS.UBS_ID,POS.SYSTEMCODE,POS.RECIPIENTCODE,POS.BUSINESS_DATE,POS.PACCT,POS.PFIRM,POS.POFFIC,POS.PCUSIP,POS.PBS,CASE WHEN POS.PSTYPE='S' THEN POS.PSYMBL ELSE POS.PFC END,
            POS.PEXCH,POS.PSUBEX,POS.PCURSY,
            CASE WHEN POS.PSBCUS IS NULL THEN SUBSTR(POS.PCTYM,5,2) || SUBSTR(POS.PCTYM,1,4) ELSE POS.PSBCUS || SUBSTR(POS.PCTYM,5,2)  || SUBSTR(POS.PCTYM,1,4) END,
            NVL(POS.PSUBTY,'F') ,POS.PSTRIK,POS.PCLOSE,TO_CHAR(CASE WHEN INSTR(POS.PUNDCP,'.') > 0 OR LENGTH(POS.PUNDCP) < 15 THEN POS.PUNDCP ELSE TO_CHAR(TO_NUMBER(POS.PUNDCP) / 100000000) END),
            POS.BBG_EXCHANGE_CODE,POS.BBG_TICKER,POS.BBG_YELLOW_KEY,POS.PPCNTY,POS.PMULTF,POS.PSUBTY,POS.SOURCE_GMI_LIB,RIC,
            CASE WHEN PSUBTY = 'S' THEN POS.TYPE ELSE NULL END,
            DECODE(POS.UBS_ID,NULL,POS.PCUSP2,POS.ISIN),POS.UNDERLYING_BBG_TICKER,POS.UNDERLYING_BBG_EXCHANGE,POS.PRODUCT_CLASSIFICATION,
            CASE WHEN PSUBTY = 'S' THEN POS.PSDSC2 ELSE NULL END,
            CASE WHEN PSUBTY = 'S' THEN C.SSDSC3 ELSE NULL END,
            NVL(C.SSECID,POS.PCUSIP),
            POS.PYSTMV,
            POS.PMINIT,
            POS.PEXPDT,
            CASE WHEN PSUBTY = 'S'  THEN  SUBSTR(C.ZDATA2,77,1) ELSE NULL END;Now, could you plz help me in replacing the bold text in the query with the requirement.
    Thanks and Rgds
    DG
    Edited by: BluShadow on 16-May-2011 09:39
    added {noformat}{noformat} tags.  Please read: {message:id=9360002} for details on how to post code/data                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Facing problem in using webutil functions

    hi,
    i have developer suite 10g(9.0.4),
    i download web util 1.0.6, update all the required changes,
    i also download the template, which shows the
    but still i am facing problem in using any function,
    when i am using get_system_property method then it return exception (06502) value or string error, and all the other functions return no_data_found exception
    please help me!!!
    with regards,
    sidharth

    Sidharth,
    unfortunately your question doesn't provide enough details to help you out of this. Please provide the code that you use in the function call that causes the exception. If you have error messages to share, the better it is.
    Frank

  • Facing problem while using aggregate functions.

    I am trying to use aggregate functions such as sum, count in my CQL query.
    It is not giving me an error but i am unable to get the correct output out of that.
    Query is:
    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application"
    xmlns:jdbc="http://www.oracle.com/ns/ocep/config/jdbc">
    <processor>
    <name>APL_EFW_CostEvent_Processor</name>
    <rules>
         <view id="CostEventView"
              schema="eventName eventType eventId opportunityStatusId opportunity_cost APL_Event_Inbound"><![CDATA[
                   SELECT      X.eventName, X.eventType,
                        X.eventId, X.opportunityStatusId,
                        X.opportunity_cost,X.APL_Event_Inbound
                        from APL_EFW_Master_Inbound_Channel
                        XMLTable (
                             '/' PASSING BY VALUE APL_EFW_Master_Inbound_Channel.APL_Event_Inbound as "."
                        COLUMNS
                             eventId char(256) PATH 'fn:data(Event/EventHeader/eventId)',
                             eventName char(256) PATH 'fn:data(Event/EventHeader/eventName)',
                             eventType char(256) PATH 'fn:data(Event/EventHeader/eventType)',
                                  opportunityStatusId char(256) PATH                               'fn:data(Event/ApplicationDataArea/opportunity/opportunity_details/opportunity_status)',
                                  opportunity_cost char(256) PATH                               'fn:data(Event/ApplicationDataArea/opportunity/opportunity_details/opportunity_cost)',
                                  APL_Event_Inbound xmltype path '/'
                        ) AS X
                   ]>
         </view>
    <query id="CostEventQuery">
              <![CDATA[
                   SELECT
                        XMLELEMENT("opportunity",
                             XMLELEMENT("cost_opportunity",
                                  XMLFOREST(X.opportunity_cost))) as APL_Event_Inbound
                             FROM CostEventView
                             MATCH_RECOGNIZE (
                             MEASURES
                                  A.opportunity_cost as opportunity_cost
                                  PATTERN (B A+) within 30000 milliseconds
                                  DEFINE
                                  A as sum(A.opportunity_cost)> 1000                    )
                        as X
              ]]>
              </query>
    </rules>
    </processor>
    </wlevs:config>
    The problem i am getting is when the value is getting compared with the opportunity cost rather than with the sum of oppCost
    A as sum(A.opportunityCost)>1000
    A as A.opportunityCost >1000
    Both the cases are treated as same .

    It would help if you could provide sample input data and associated output that illustrates the problem

  • Problem while using aggregate functions in EJB QL 2.1

    Hai all,
       I am using aggregate function as follows
       select max(c.id) from customer as c
      for this iam selected check box EJB QL 2.1 in persistent.xml
      this is validated by nwds, but while deploying server raising error like ejb ql syntax error.
      Actually according to EJB QL 2.1 this is a valid query, what i need to do for run this same query .
      Anybody please help me in this regard
    Regards
    Somaraju

    Beevin
      Both two are not even validated,
      but with the first one as select max(c.id) from customer as c , in this case it is validated but while deploying it is error as , object must be return
      But when i saw  the ejb2.1 specification we can write this type of queries also ?
      Is it problem with was any thing
    Regards
    Somaraju

  • Can I use split function in PLD?

    Dear Experts,
    Can anyone show me if I have this value in a variable F_001 in PLD.
    012345-FAB
    How can I get the below output?  (Taking off the -FAB, by either using a split() function or equivalent)
    012345
    Much Thanks!
    Chinho

    Hi Chinho,
    ok, for example, IF you use add the last 4 Character only in CardCode(-FAB)
    F_001 -> CardCode = 012345-FAB
    or
    F_001 -> CardCode = 1000123456-FAB
    or
    F_001 -> CardCode = 987456814-ADM
    but you need to print the Value of CardCode is before last 4 Character Value .
    Output: 012345 or 1000123456 or 987456814
    Try this formula in PLD.
    Substring(F_001,0,(Length(F_001)-4))
    Regards,
    Madhan.

  • I have a problem in using the function 'WS_DELIVERY_UPDATE'

    I want to update the delivery document at the batch field (CHARG = '0000000605') by using the function 'WS_DELIVERY_UPDATE'.
    Before update, this batch field is initial.
    After having completely updated this delivery, I try to update this batch field again. However, I found the error message showing that 'Confirmed batch 0000000621 is different from batch 0000000605 for main item'.
    How can I solve this problem to update this batch again? This error occurs when I use function 
    'WS_DELIVERY_UPDATE', 'BAPI_OUTB_DELIVERY_CONFIRM_DEC', and 'BAPI_OUTB_DELIVERY_CHANGE'.

    Check OSS 674567.

  • ESB problem when use merge function in master/detail relationship

    I have some problem with the merge function in database adapter.
    details:
    I have 2 tables in master/detail relationship, both have GUID column as a primary key (GUID generated by ESB).
    'car_group' table
    pk : guid
    unique : group_no, datadate, datatime
    ===============================
    guid, group_no, datadate, datatime, group_detail
    ===============================
    1, 1, 01/01/2008, 09:00, groupdetail01
    2, 1, 01/01/2008, 10:00, groupdetail02
    'car_group_detail' table
    pk : guid
    fk : car_group_guid link to car_group.guid
    ==================
    guid, car_group_guid, detail
    ==================
    1, 1, detail01
    2, 1, detail02
    3, 2, detail03
    4, 2, detail04
    I used a file adapter as a input, here is an example text file
    M, 1, 01/01/2008, 09:00, groupdetail01
    D, detail01
    D, detail02
    M, 1, 01/01/2008, 10:00, groupdetail02
    D, detail03
    D, detail04
    Because I used merge function so I need to specify the columns that will be a condition for the insert/update,
    but I have generate GUID as a primary key in the tables, I can't used it, so in toplink I map my unique key as a primary key.
    The insert operation work fine but when update is required (for example, try to change 'group_detail' column of the master table in text file),
    an SQLException thrown, the log file shown the adapter try to update the GUID column of master table but the constraint not allowed.
    And yes, cause of GUID generate everytime so ESB try to update this column also, but I don't want to do like that, I need something
    like when update operation required, just ignored the GUID column.
    I try to mark read-only to the GUID column in Toplink mapping file but still have the same problem, it still generate UPDATE statement
    with the GUID column, and also I try to let the database trigger to generate GUID instead of ESB function, but it not works in master/detail
    relationship (I think the Toplink manage the relationship, is it right ?)
    Please advise, thanks for advance.

    somebody please help, thanks !!!

  • PROBLEM when use topN function  - Essbase connection

    Guys,
    please help me. I'm trying to rank a number of clients using TopN function by revenue but when i order my Top 10 the Analysis log out. And always when i log in again continue logging out...
    U guys can help?
    Tnks,
    Lucas

    Please go to http://zone.ni.com/reference/en-XX/help/371361B-01/lvtextmath/msfunc_classes/ and see if "saveas" is an available function in LabVIEW MathScript.
    As a matter of fact,I do not see the need to complete the file I/O inside the MathScript node,Why do you want to do that?

  • Problem with using SPrintf function in a cpp file

    SPrintf can be used with .c extension, but when it's used in a .cpp then you get the following:
    Error C2664: 'SPrintf' : cannot convert parameter 1 from 'char [10]' to 'unsigned char *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
    Error executing cl.exe.
    But it does compile with .c extension, however this time the rest of the code doesn't work.
    Any ideas?
    Thanks,
    Sacit

    Kevin,
    Here is a piece from the code:
    CIN MgErr CINRun(LStrHandle ParameterFilePath, LStrHandle DataFilePath, LStrHandle OutputFilePath, int32 replace, int32 ver, int16 calrange, int16 istof, LStrHandle OutputString)
    int i, StartCh, ChannelNum;
    double Density, a, b, sigmachn, sigmawin, sigmascattp, EInit, angle, ns, es,
    concentration, totalweight, conversion, Dsample, Count[2048], NetCnts;
    char temp[15], Z1Name[2], Z2Name[10][2];
    char parafilename;
    //char *datafilename = "";
    //char *outfilename = "";
    //char *cMessageText;
    // Make necessary conversions.
    LStrLen (*OutputString) = LStrLen(*ParameterFilePath);
    //MoveBlock(LStrBuf(*ParameterFilePath), LStrB
    uf(*OutputString), LStrLen(*ParameterFilePath));
    MoveBlock(LStrBuf(*ParameterFilePath), & parafilename, LStrLen(*ParameterFilePath));
    MoveBlock(& parafilename, LStrBuf(*OutputString), LStrLen(*ParameterFilePath));
    ifstream parafile, infile;
    ofstream outfile;
    Ion_Target mIon_Target;
    mIon_Target.Z2 = new int(10);
    mIon_Target.M2 = new double(10);
    mIon_Target.F = new double(10);
    // Open parameter file...
    parafile.open((char *)parafilename, ios::in|ios::nocreate);
    if(parafile == NULL)
    //cMessageText = "Couldn't Open Parameter File. Maybe it doesn't exist";
    // return -1;
    return fIOErr;
    parafile.close();
    The problem is I have to use ifstream method, because the rest of the code depends on it, and I don't want to deal with the conversion. Otherwise, I would have used FMOpen/FMClose utilities.
    So the problem is obvious as you see, all I need is to convert LStrHandle to a char.
    When I run the code from LabVIEW, "The instruction at "0x77f83e91" referenced at "0x555c3a44". The memory could not be "read"." error message appears.
    I'd appreciate your help.
    Sacit
    Attachments:
    sc.cpp ‏15 KB

  • Problem to  Use C function in oracle

    Hi Friends,
    i m trying to use c funciton in oracle
    as per oralce documentation its working fine when i used the demo example
    but in demo example thr are only interger data type used
    i need to use the char data type from c
    and while calling that function in c when i tried to call char as parameters data type
    its giving following error :
    SQL> CREATE OR REPLACE FUNCTION endecrypt(
    2 x Varchar2,
    3 y BINARY_INTEGER)
    4 RETURN Varchar2 AS
    5 EXTERNAL LIBRARY pass
    6 NAME "crypt" -- Name of function call. Quotes preserve lower case.
    7 LANGUAGE C
    8 PARAMETERS (x Char, y short);
    9 /
    Warning: Function created with compilation errors
    SQL> show err
    Errors for FUNCTION PRIME.ENDECRYPT:
    LINE/COL ERROR
    8/16 PLS-00235: the external type is not appropriate for the parameter
    0/0 PL/SQL: Compilation unit analysis terminated
    the bold part (x char) at line number 8 is having problem
    how can i solve it ?????

    If you had read the documentation as you claim to have done so you would know that STRING is probably what you want.
    Cheers, APC

  • Binding problem when using NVL function

    Hello.
    I have a problem with my ADF application (11.1.2.1).
    I use VO with a query (database view) - pivot table.
    If i use where clause like table.attr = :p_attr, everything works ok.
    If i use where clause like table.attr = NVL (:p_attr, table.attr) and put a value in :p_attr (executeWithParam) , query executes as if there is a null value.
    Debug console shows:
    Binding null of type 12 for "p_attr".
    Query with NVL works ok in sqldeveloper.
    But in jdev, as if the table attribute isn't bind to bind variable.
    If a just remove NVL function, it works.
    Any idea?
    Thanks.
    Regards
    Edited by: DejanH on Oct 6, 2011 1:32 PM

    Hello.
    I enter 50 in p_depart parameter and click "ExecuteWithParams". Query is executed and shows records (pivot table).
    But if i look at the log window i see that an empty query was executed first.
    <OracleSQLBuilderImpl> <bindParamValue> [427] Binding null of type 12 for "p_depart"
    <OracleSQLBuilderImpl> <bindParamValue> [428] Binding null of type 12 for "p_job"
    <OracleSQLBuilderImpl> <bindParamValue> [429] Binding null of type 12 for "p_hire_od"
    <OracleSQLBuilderImpl> <bindParamValue> [430] Binding null of type 12 for "p_hire_do"
    Then, it is autoexecuted for the second time with parameter set to the value i inserted.
    <OracleSQLBuilderImpl> <bindParamValue> [470] Binding param "p_depart": 50
    <OracleSQLBuilderImpl> <bindParamValue> [471] Binding null of type 12 for "p_job"
    <OracleSQLBuilderImpl> <bindParamValue> [472] Binding null of type 12 for "p_hire_od"
    <OracleSQLBuilderImpl> <bindParamValue> [473] Binding null of type 12 for "p_hire_do"
    The same happens in our query. But ours is much more complex and it takes a lot of time to first execute "empty" query and then with inserted parameter.
    We cannot use it.
    It looks like bug.
    Regards
    Edited by: DejanH on Oct 11, 2011 6:52 AM

  • Problem while using Alv Block List

    HI All,
    PLZ help me .
    By using this code I select data from TXT file and insert data in CS13 transaction then I want to show each material which present in TXT file as ALV BLOCK DISPLAY.
    Suppose txt file contain 4 material so report will show 4 list block .means data of every material showing in different blocks in the report.
    Code which I am using showing showing data only for last material which present in the table it_matmaster in every block.
    Please guide me what is the problem.
    I am pasting changed code for you.
    i am using below codes..........
    *& Report  ZCS13                                                       *
    REPORT  zcs13                                   .
    TABLES:
            mara,
            stpo,
            t001w,
            stko.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it_stb OCCURS 0.
            INCLUDE STRUCTURE zstpox.
    DATA:END OF it_stb.
    DATA: BEGIN OF it_matmaster OCCURS 0,
          matnr TYPE matnr,
          werks TYPE werks,
         stlal type stlal,
         capid type capid,
          emeng TYPE emeng,
          END OF it_matmaster.
    DATA : ievent TYPE slis_t_event.
    DATA: it_stb2 LIKE stpox OCCURS 0 WITH HEADER LINE,
    it_stb3 LIKE stpox OCCURS 0 WITH HEADER LINE,
    temp_cat TYPE slis_fieldcat_alv,
    sline TYPE slis_listheader,
    gt_list_top_of_page TYPE slis_t_listheader,
    gs_layout TYPE slis_layout_alv ,
    gt_events TYPE slis_t_event,
    gt_sort TYPE slis_t_sortinfo_alv,
    w_msg(255) TYPE c,
    int TYPE i VALUE 0.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    PARAMETERS:p_file LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1 .
    CONSTANTS c_x VALUE 'X'.
    DATA: w_topmat LIKE cstmat,
        fieldcat TYPE slis_t_fieldcat_alv ,
         wa_fieldcat TYPE slis_fieldcat_alv.
    DATA:v_file TYPE string.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = 'P_FILE'
        IMPORTING
          file_name     = p_file.
    START-OF-SELECTION.
      v_file = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = v_file
         filetype                      = 'ASC'
         has_field_separator           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          data_tab                      =  it_matmaster
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        i_callback_program             = 'ZCS13'
      I_CALLBACK_PF_STATUS_SET       = PFSTATUS
       i_callback_user_command        = ''
      IT_EXCLUDING                   =
    PERFORM fldcat.
      LOOP AT it_matmaster.
        PERFORM explode_assembly.
        PERFORM fldcat.
        PERFORM append_blocklist.
       PERFORM alv_display_grid.
      ENDLOOP.
      PERFORM alv_display_grid.
    *&      Form  EXPLODE_ASSEMBLY
          text
    FORM explode_assembly.
    CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
      EXPORTING
        capid                 = 'BEST'
        cuols                 = c_x
        datuv                 = sy-datum
        emeng                 = it_matmaster-emeng
        knfba                 = c_x
        ksbvo                 = c_x
        mehrs                 = c_x
        mbwls                 = c_x
         mdmps                 = c_x
        mktls                 = c_x
         stlal                 = it_matmaster-stlal
         stlan                 = p_bomap
        mtnrv                 = it_matmaster-matnr
        werks                 = it_matmaster-werks
         svwvo                 = 'X'
         vrsvo                 = 'X'
      IMPORTING
        topmat                = w_topmat
      TABLES
        stb                   = it_stb
      EXCEPTIONS
        alt_not_found         = 1
        call_invalid          = 2
        material_not_found    = 3
        missing_authorization = 4
        no_bom_found          = 5
        no_plant_data         = 6
        no_suitable_bom_found = 7
        conversion_error      = 8
        OTHERS                = 9.
    IF sy-subrc <> 0.
       MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
               INTO w_msg.
       WRITE: / w_msg.
       EXIT.
    ENDIF.
    ENDFORM.                    "explode_assembly
    *&      Form  fldcat
          text
    -->  p1        text
    <--  p2        text
    FORM fldcat .
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = 'ZCS13'
      i_internal_tabname           = 'IT_STB'
         i_structure_name             = 'ZSTPOX'
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = 'ZCS13'
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = fieldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_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.
    ENDFORM.                    " fldcat
    *&      Form  alv_display_grid
          text
    -->  p1        text
    <--  p2        text
    FORM alv_display_grid .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
         EXPORTING
           i_interface_check             = 'x_print_layout'
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
         EXCEPTIONS
           program_error                 = 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.                    " alv_display_grid
    *&      Form  append_blocklist
          text
    -->  p1        text
    <--  p2        text
    FORM append_blocklist .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                        = gs_layout
          it_fieldcat                      = fieldcat
          i_tabname                        = 'IT_STB[]'
          it_events                        = gt_events
         it_sort                          = gt_sort
      I_TEXT                           = ' '
        TABLES
          t_outtab                         = it_stb[]
       EXCEPTIONS
         program_error                    = 1
         maximum_of_appends_reached       = 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.
    ENDFORM.                    " append_blocklist

    Hi ,
    Use the upload function 'WS_UPLOAD' . Declare ITAB of type table of your choice.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                FILENAME                = FILENAME( Has to specified by you )
                FILETYPE                = 'ASC'
           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
                GUI_REFUSE_FILETRANSFER = 8
                CUSTOMER_ERROR          = 9
                OTHERS                  = 10.
    LOOP AT ITAB.
    Use Split function to seperate the fields of the Internal table and append to a new Internal table of your choice.
    ENDLOOP.

  • How to use contains() function in bpel?

    Hi
    Am facing a problem in using contains() function in a switch case... my condition inside a switch case is contains(bpws:getVariableData('singleSIS'),bpws:getVariableData('singleSIS_check')) where the variable 'singleSIS' has a value 'ABCDE' and 'singleSIS_check' has a value 'ABCDE' ... Ideally this condition should return true,but its not happening..Can someone tell me what is the issue with this ?
    P.S both the variables are of string type. Please help me with this..

    Sure:
    <?xml version = "1.0" encoding = "UTF-8" ?>
    <!--
    Oracle JDeveloper BPEL Designer
    Created: Fri Apr 06 12:41:59 IDT 2012
    Author: DELL
    Purpose: Asynchronous BPEL Process
    -->
    <process name="BPELProcess1"
    targetNamespace="http://xmlns.oracle.com/SodaDev_jws/Project4/BPELProcess1"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:client="http://xmlns.oracle.com/SodaDev_jws/Project4/BPELProcess1"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
    xmlns:mhdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.mediator.service.common.functions.MediatorExtnFunction"
    xmlns:bpel2="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:oraext="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
    xmlns:dvm="http://www.oracle.com/XSL/Transform/java/oracle.tip.dvm.LookupValue"
    xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
    xmlns:med="http://schemas.oracle.com/mediator/xpath"
    xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
    xmlns:bpm="http://xmlns.oracle.com/bpmn20/extensions"
    xmlns:xdk="http://schemas.oracle.com/bpel/extension/xpath/function/xdk"
    xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
    xmlns:bpmn="http://schemas.oracle.com/bpm/xpath"
    xmlns:socket="http://www.oracle.com/XSL/Transform/java/oracle.tip.adapter.socket.ProtocolTranslator"
    xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap">
    <!--
    PARTNERLINKS
    List of services participating in this BPEL process
    -->
    <partnerLinks>
    <!--
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    <partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>
    </partnerLinks>
    <!--
    VARIABLES
    List of messages and XML documents used within this BPEL process
    -->
    <variables>
    <!-- Reference to the message passed as input during initiation -->
    <variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>
    <!-- Reference to the message that will be sent back to the requester during callback -->
    <variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>
    </variables>
    <!--
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    -->
    <sequence name="main">
    <!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1.wsdl) -->
    <receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>
    <!--
    Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
    -->
    <switch name="Switch_1">
    <case condition="contains(bpws:getVariableData('inputVariable','payload','/client:process/client:input'), 'ABCDE' )">
    <empty name="Empty_1"/>
    </case>
    <otherwise>
    <sequence>
    <empty name="Empty_2"/>
    <empty name="Empty_3"/>
    </sequence>
    </otherwise>
    </switch>
    <invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>
    </sequence>
    </process>

  • Difficulty in creating a chart by using a function with a returned value

    Hi,
    I am having a problem in using own function to create chart a with a returned value as the chart. If not using the returned value, it works fine.
    Is this a known issue?

    If you share some code, we might be able to help you.

Maybe you are looking for