Split field values into range

Hi,
I have a 'Company Code' field in an input file that can contain 1 or multiple company codes, separated by comma (,). e.g it could be anything from '1105' to '1105,3000,2000,2200' etc up to about a max of 20 company codes.
I don't think it's efficient or good programming to do the following;
    SPLIT l_bukrs_string AT ';' INTO
l_bukrs1
l_bukrs2
l_bukrs3
l_bukrs4
l_bukrs5
l_bukrs6.
etc etc up to the maximum (I would be declaring up to 20 more fields).
The ideal would be if I can get the list of company codes (from the field), into a range. So as per my example above, I would left with a range R_BUKRS that contains the single values 1105,3000,2000,2200. I can then loop at this range later on and do the rest of my company code specific processing.
And ideas - possible use of field symbols? Thanks alot

Hi
You can use same slit statement to store data in internal table.
My idea is to slit the file into internal table and use this internal table like for all entries in or like select-options.
SPLIT text_flie AT ',' into table IT_BUKRS.
select * from dbtable for all entries in it_BUKRS
  condn
Hi Shrini you I posted on the same time, I did not copied, sorry
Thanks,
Anmol.
Edited by: anmol112 on Feb 15, 2011 9:25 AM

Similar Messages

  • How to populate custom table field value into standard DFF

    Hi Gurus
    I am newbie to the OAF
    I have a requirement to populate the custom table field value into standard DFF. we enabled the DFF in ReqDistDFFOnAcct(po_req_distributions_all). On the requisition tab as soon as i click on the checkout button, the custom field value has to be shown in the requisition distributions DFF field along with the standard Columns like charge account, percent, qty and when we click on the next button, it has to hit the base table ie., po_req_distributions_all.
    the standard columns data is showing the screen. how to acheive this requirement programatically
    There is a EO for the req distributions table. please help me how to achevie this requirement.
    Any help woud be greatly appreciated.
    Thank You!
    Krishna

    Thanks Aj. Finally i made some progress....but i am getting an error in the inst_top OPMN folder 10/10/08 15:37:14 Error: <connector name="OracleASjms" path="OracleASjms.rar" /> will not be bootstrapped since corresponding module declaration was not found in application.xml. I cleared the cache, bounced the webserver. Could not able to understand what is this error
    Following is the code that i have written. I am not able to find out what is the error. please help me how to fix this error. there is no changes in the page and the value is not auto populating. the page is having the normal behaviour as the standard one.
    Thanks in Advance for your help...
    public class xxCheckoutDistsCO extends CheckoutDistsCO
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    String UnitId="";
    //First get the Application Module
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAViewObject vo = (OAViewObject)am.findViewObject("PoRequisitionLinesVO");
    String Reqlineid="";
    String Linenum="";
    String DeliverLoc="";
    if(vo.first() !=null)
    Reqlineid= vo.first().getAttribute("RequisitionLineId").toString();
    Linenum = vo.first().getAttribute("LineNum").toString();
    DeliverLoc = vo.first().getAttribute("DeliverToLocationId").toString();
    // if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    // pageContext.writeDiagnostics("TEST >", Reqlineid,1);
    // pageContext.writeDiagnostics("TEST >", Linenum,2);
    // pageContext.writeDiagnostics("TEST >", DeliverLoc,3);
    UnitId=null;
    String Querry="select amli_icx_oaf_utils.get_blding_unit_id (?,?,?) from dual";
    try
    PreparedStatement ps=am.getOADBTransaction().getJdbcConnection().prepareStatement(Querry);
    ps.setInt(1,Integer.parseInt(Reqlineid));
    ps.setInt(2,Integer.parseInt(Linenum));
    ps.setInt(3,Integer.parseInt(DeliverLoc));
    ResultSet rs=ps.executeQuery();
    // ps.execute();
    // am.getOADBTransaction().commit();
    while (rs.next())
    System.out.println(" Query Results ");
    UnitId= rs.getString(1);
    System.out.println(" first > ");
    rs.close();
    ps.close();
    catch(SQLException a)
    System.out.println(" Error "+a);
    System.out.println(" Second > ");
    System.out.println(" Third > "); ----the program is executing upto here...it is not setting the value after this.
    OAViewObject povo = (OAViewObject)am.findViewObject("PoReqDistributionsVO");
    if(povo.getCurrentRow()!=null ) --------If i remove this condition i am getting the nullpointer exception in page.....
    System.out.println(" Fourth > ");
    povo.getCurrentRow().setAttribute("Attribute12",UnitId);
    // if(pageContext.isLoggingEnabled(OAFwkConstants.STATEMENT))
    // pageContext.writeDiagnostics("TEST >", UnitId, 1);
    Thanks
    krishna

  • Splitting Fields Values from A to B, C, D

    I am new to portal forms and need some help on managing fields
    values. The requirement is I want the value of a field to split
    up into three different fields. for example : Field A has
    value 'THIS IS FOR TESTING' and B, C, D fields should
    have 'IS','FOR','TESTING' respectively.. This should happen as
    soon as i leave the field 'A'.
    I would be very thankful if anyone can help me with this.
    Thanks!!

    Maps have a smart feature that recall your ending location.
    If you had one map with start and end location, i.e. San Francisco to Paris, adding a second map, will already display Paris as a start location.
    This is true with both Globe and Flat maps.
    However, to adjust zoom level with Flat Maps, you can click the Crop tool bar and access the Ken Burns effect, adjusting the zoom on the Preview Window.

  • How to read the input field value into ABAP variable?

    Hi All,
    i need a read the value of an input field into an ABAP variable,and i am doing this in the following way
    lstring = request->get_form_field('myFlag').
    here 'myFlag' is the input field name,but this is not returning me any value into lstring.
    I have gone through the SDN and tried to do this.
    could you please help me out to resolve this issue.
    Thanks in Advance,
    Praveena

    Dear Praveena
    In which event are you putting this code. Place it in oninputprocessing event(Page with flow logic Model of coding). Then it will surely work.
    Regards
    Vijay.M

  • Combining Multiple occurrencesof the same field value into one and Sum prob

    Hi
    I am trying to combine the multiple occurrences of the field values and sum the amount to the target
    Source
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>15</Amount1>
    <Amount2>15</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    </Record>
    Target
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>25</Amount1>
    <Amount2>25</Amount2>
    </Item>
    </Record>
    I am using MM at present. All fields are KeyFields here. Should check against each other.
    I followed Context setting to the Root Item and Sort, SplitByValue and CollapseContext to achieve the functionality.
    But it checks against each field and not all fields. So either one field has different value, only that perticular field gets into New Node and not the entire record. In this case, i might need UDF i guess. Any UDF help is much appreciated
    Bad Target example of what i am getting
    Source
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>15</Amount1>
    <Amount2>15</Amount2>
    </Item>
    <Item>
    <Item1>2</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>5</Amount1>
    <Amount2>5</Amount2>
    </Item>
    </Record>
    Target
    <Record>
    <Item>
    <Item1>1</item1>
    <item2>2</item2>
    <item3>3</item3>
    <item4>4</item4>
    <Amount1>25</Amount1>
    <Amount2>25</Amount2>
    </Item>
    <Item>
    <Item1>2</Item1>
    </Item>
    </Record>
    In the above scneario, only Item1 returns the value into different node. But i like to have entire node values into the record, if one value changes in the entire record.
    Appreciate your help with the UDF in advance
    </Record>

    I think you are looking for string aggregation.
    The following are the replies posted by me in the forum recently on the same case.
    they might help you.
    Re: Concatenating multiple rows in a table - Very urgent - pls help
    Re: Doubt in a query ( Urgent )
    Re: How to remove words which consist of max 2 letters?
    Re: output like Name1,Name2,Name3...

  • Split a value into two based on VERSION type in ODS

    Hello Gurus,
    I have a field in the cube called AMOUNT. It is plan or actual value based on a field called VERSION in the ODS.
    Can you please tell me how to display two columns in the report (Acutal and Plan columns) from one field called AMOUNT in the cube, based on the VERSION field value in ODS.
    Your responses are highly appreciated,
    Thanks,
    Regards,
    aarthi
    [email protected]

    Hi Diego,
    I don’t have version field in the Cube. It is available only in the ODS. So, how to filter based on VERSION.
    Hi Oscar,
    Is there any way I can access the VERSION value from ODS in the report.
    Thanks
    Regards,
    aarthi
    [email protected]

  • Import screen field value into search help assigned to a different field

    Hi,
    I have created an elementary search help based on a custom DDIC table ZSH_SHHLDR. Dialog Type: Dialog depends on set of values, search help parameters:
    Parameter                       Import     Export   LPos SPos  SDis
    FOLIO                                X                       1       1         X
    CERTN                                             X         2       2
    where FOLIO and CERTN are fields in my table.
    There are two fields in my program defined as like FOLIO and CERTN respectively. These fields are screen fields in a custom dynpro created using Screen Painter. The search help is assigned to the CERTN field. In the screen, I want that the contents of the FOLIO field should be imported into the search help, i.e. on the screen:
    FOLIO: 21353
    CERTN: <F4>
    When I click on F4 help for CERTN, I want that the FOLIO parameter in the search help should contain the value for FOLIO that I entered in the text box on the screen. Is there a way to do this, through an exit for instance? Help is appreciated, thanks.
    Regards

    Hi,
    You need to use the below statement.
    process on value-request.
    field zcom_doa_users-zzjob_role module sub_tes_module.
    Here I declared three fields in the screen fields from structure zcom_doa_users. Try to name the fields with table name-field name. So inside the module in structure zcom_doa_users you will get given value for the other fields also.
    Now you can do your own processing for f4 help.
    Thanks
    Subhankar

  • Is there any function to split string value into diff junks

    Hi guys i have a string value as below
    14507|||Subterranean Masquerade||||||Subterranean Masquerade
    you can say ||| is a field delimiter.
    i want to split each field identified by ||| delimiter and store in a collection table.
    is there any easy way to that?
    Thanks
    Asif

    actually i want to use DIY$ dynamic view and what i did.
    1) I created a object type as xyz_row_type with 4 attributes.
    2) then i created a collection type xyz_tab_type of xyz_row_type
    3) now i want to create a function which will return me xyz_tab_type
    i am using a utl_file.get_line(file_name,f_line_txt)
    each line has the four elements delimited by '|||' shown below
    14522|||Lessig|||Minna|||Lessig, Minna
    i want to split each element for each attribute of xyz_row_type.
    How can i do this?

  • In BO 4.0,how to convert field values into column heading.

    Currently Product Codes are represented in "Code" and "Value" fields.
    Please retain the code and value fields, so that if the user adds another code and immediately needs to report on them they can through this functionality.
    Current:
    Fund Code
    Code
    Value
    ABC1
    Embassy Series
    XYZ123
    ABC1
    FMI
    19837
    ABC1
    Gladis Short Name
    FUJHAT
    Required:
    Fund Code
    Embassy Series
    FMI
    Gladis Short Name
    ABC1
    XYZ123
    19837
    FUJHAT

    Hi Archana,
    I think you need to use a Cross Tab on your report but also you will need to apply Sections on the Fund Code dimension.
    ie
    Section 1 - ABC1
    Crosstab
    Section 2 - ABC2
    Crosstab
    Section 3 - ABC3
    Crosstab
    With regards
    Gill

  • Split String value into internal table at Carriage return

    Hi All,
    I have given a string type context ( text edit  box ) to the user to enter the values. The data can have carriage returns also.
    My Requirement is that I want to split the data at carriage returns and store it in my tables.
    I tired with a constant value of '%CR_LF' as available in CL_ABAP_CHAR_UTILITIES but to no good result.
    Can the Experts suggest some solution?/??
    Thankx in advance.
    Regds,
    Srini

    Hi Srini,
    Have you looked at your string containing the text in the debugger to verify that you really have <CR>+<LF> (i.e. reflecting CL_ABAP_CHAR_UTILITIES=>CR_LF, which should be easily visible when looking at the hex codes of the string)? Maybe it's just a <LF> (i.e. CL_ABAP_CHAR_UTILITIES=>NEWLINE). Might be good to do a REPLACE first using a regular expression for identifying the line feeds and then doing the SPLIT.
    Cheers, harald
    p.s.: If you still cannot get it to work, provide some more details of what you're doing...

  • Manually entering field values into report

    Hi, I am running a call report for a contact centre and the reports shows information such as numbers of calls received/answered, duration of calls, grade of service, etc. What I am wanting it to also include forcasted calls into the report. I do not have write access to the database (otherwise this would be very straight forward). The report in the end will get exported as a PDF document but I would like to be able to run the report and have some sort of prompt asking for the forcasted calls for each day ( I am showing multiple days on the report). They vary from day to day. Is there any way to do this? I'm reasonably new to crystal as well so simplicity is good. Thanks, Paul.

    Hi Paul,
    Crystal Reports is a tool that will allow you to read data from the database.  If your database contains a field that contains data for 'forecasted calls' you can place that on the report to display.  You will not be able to write data to the database from Crystal Reports.
    If you do not have a field that contains data for forecasted calls,  you might be able to create a formula to generate that.
    In regards to creating a prompt,  you can create a parameter in Crystal Reports from the Field Explorer.  Once you've created the report you can add that to the record selection formula (Report|Selection Formula|Record...)
    {yourforecast.field} = {?your.parameter}
    Regards,
    Wallie

  • How to insert image file as a field value into blob field type using insert statment

    i have a column named picture of datatype BLOB
    now i want to insert an image file into that column using
    INSERT state so that it can be called in a jsp file using
    getBLOB request method.
    HELP!!
    thank you
    sal

    See this link
    http://www.psoug.org/reference/dbms_lob.html

  • Mapping Issue: How to split the value  of Lineitem

    Hi  All,
    I have issue in Mapping .XML-> BAPI Scenario
    1 line item  has the  one 50% Cost Centre , another 50% Cost centre data
    2 line item has only      100% WBS elemnt
    WBS elemnt mapping :
    If A |EQUALS (Text) | WBS_ELEMNT   |If without else|  B(WBS value)  |REmoveContexs| SplitByValue|   WBS_ELEMNT(BAPI field)
    But this supress second line item : WBS_ELEMNT data and uploads into1.Item .Hence PO is not getting created in SAP.
    Could you please giv me a logic to actaually split the value into 2 seperate so that respective data of each line item  are split properly .
    Thank you ,
    Vara

    Hi I think you need an udf for this:
    int total = Integer.parseInt(value[0]);
    result.addValue(Integer.toString(a/2));
    result.addValue(Integer.toString(a/2));
    and after it you can add a splitbyvalue

  • F4 HELP FOR ONLY SELECTED FIELD VALUES

    Hi,
    I have to display the F4 help for the selection screen field parameter. From the ICON table, I need to display the field ID values. In the ICON table, I have lot of field values for the field ID, but I need to display only 3 field values into F4 help.(like say @07@, @08@, @0A@ only at the F4 help).
    Thanks in advance.
    Regards
    Ramesh mavilla.

    Hi,
    See the follwoing code example
    REFRESH: I_DYNPREAD .
    CLEAR : I_DYNPREAD .
    I_DYNPREAD-FIELDNAME = 'P_KAPPL'.
    APPEND I_DYNPREAD.
    CLEAR I_DYNPREAD.
    L_REPID = SY-REPID .
    L_DYNNR = '1000' .
    CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
    DYNAME = L_REPID
    DYNUMB = L_DYNNR
    TABLES
    DYNPFIELDS = I_DYNPREAD.
    IF SY-SUBRC EQ 0.
    READ TABLE I_DYNPREAD INDEX 1.
    P_KAPPL = I_DYNPREAD-FIELDVALUE.
    ENDIF.
    REFRESH: I_DYNPREAD .
    CLEAR : I_DYNPREAD .
    REFRESH: I_KSCHL.
    TRANSLATE P_KAPPL TO UPPER CASE.
    TRANSLATE P_KVEWE TO UPPER CASE.
    SELECT KAPPL KVEWE KSCHL VTEXT FROM T685T
    INTO CORRESPONDING FIELDS OF TABLE I_KSCHL
    WHERE KAPPL = P_KAPPL
    AND KVEWE = P_KVEWE
    AND SPRAS = 'EN'.
    IF SY-SUBRC <> 0.
    MESSAGE E001(ZZ) WITH 'No Condition Type exist for Application'.
    *p_kappl ' and Usage' p_kvewe.
    ELSE.
    REFRESH: I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'KAPPL'.
    I_FIELDS-SELECTFLAG = ''.
    APPEND I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'KVEWE'.
    I_FIELDS-SELECTFLAG = ''.
    APPEND I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'KSCHL'.
    I_FIELDS-SELECTFLAG = 'X'.
    APPEND I_FIELDS.
    I_FIELDS-TABNAME = 'T685T'.
    I_FIELDS-FIELDNAME = 'VTEXT'.
    I_FIELDS-SELECTFLAG = ' '.
    APPEND I_FIELDS.
    CLEAR: V_SEL.
    CALL FUNCTION 'HELP_VALUES_GET_NO_DD_NAME'
    EXPORTING
    CUCOL = 0
    CUROW = 0
    DISPLAY = ' '
    SELECTFIELD = 'KSCHL'
    TITEL = 'Cond Type'
    IMPORTING
    IND =
    SELECT_VALUE = V_SEL
    TABLES
    FIELDS = I_FIELDS
    FULL_TABLE = I_KSCHL
    IF SY-SUBRC = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDIF. "SY-SUBRC.
    And also go throw the link which it clears more about F4
    Check the link below for creating collective search help
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ee86446011d189700000e8322d00/content.htm
    Check the ink below for creating elementary search help
    http://help.sap.com/saphelp_erp2005/helpdata/en/cf/21ee5f446011d189700000e8322d00/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/3d/e53642e2a3ab04e10000000a1550b0/content.htm
    <b>Reward with points if helpful.</b>
    Regards,
    Vijay

  • Change field value

    Hi all,
    I wanna change the field value into "No data" if the field value is null. How to do it ? any suggestion is welcome.Thank very much.

    Here's an example:
    <?if:ADDRESS2=''?>No Data<?end if?><?if:ADDRESS2!=''?><?ADDRESS2?><?end if?>
    To format it correctly, you may have to use if@inlines instead of if.
    <?if@inlines:ADDRESS2=''?>No Data<?end if?><?if@inlines:ADDRESS2!=''?><?ADDRESS2?><?end if?>
    Shreedev

Maybe you are looking for

  • ABAP custom program to generate HIPAA 834 file format

    Hi Guru's, I have a requirement to generate the HIPAA 834 file format for all the interfaces  ABAP  HR programming. Could you please suggest me is there any sample code or program or FM or Class to generate this file format . It would be veryhelpful

  • Unable to Install PSE 9 on Mac

    Hello all, I brought Roxio 11 Pro and it has a full version of PSE 9 included with it. After downloading and going through the install process it freezes then crashes after the registration phase (I have an Adobe Account). I then downloaded from Adob

  • Ink is always running out

    The first two I said okay that can happen, but now this is the 3rd ink I have had to refill the printer.  It just won't print even it is low.  I rarely print and the printer is always out of ink!  I heard it evaporates, but that just is crazy!  I hav

  • "Mirror Agent"

    After using the same iMac G5 and OS 10.3.9 for two years (with no problem), suddenly when I try to log out I get the message "mirror agent canceled log out". I can only log out after closing each program that had been opened. I cannot find "mirror ag

  • SRM 7.0 POWL Removal of TABS   - Only for Particular Roles

    Hi All, We are upgrading onto SRM 7.0 and one of the business requirements is to remove tabs "Team Carts" and "Confirmation of Team Carts" from POWL. However the requirement is to exclude it only for one particular role. How can we achieve this? I kn