MOVE THE SECOND FIELD VALUES

hi guys,
I am uploading the data for open AR items from an PIPE delimiter file. I read the data into an internal table and spilit the data at pipe delimiter.... now I have to do some validations.
There is one trailer record at the end in the file. In that trailer record I get the number of records in the second field like
9|20|100.000|10.000|        here 20 is the number of records
if it is a standard structure file then i can write the logic as
IF V_FNAME1 NE 'X'.
    DESCRIBE TABLE I_FILEDATA1 LINES V_FILEDATA1.
    READ TABLE I_FILEDATA1 INTO WA_FILEDATA1 INDEX  V_FILEDATA1 .
    MOVE WA_FILEDATA1+2(5) TO V_LINES1 .
    IF V_FILEDATA1 NE V_LINES1.
      MESSAGE 'NUMBER OF LINES READ ARE NOT SAME' TYPE 'E'.
    ENDIF.
  ENDIF.
In the above logic i counted the number of records and compared that number with the number of records given in the trailer record (20)
how to modify this logic if the file is a pipe delimiter file.....
how to capture that value into one variable can any one guide me please......
SRI

Are you planning to do this within the previous READ_FILE_DATA subroutine or outside? Is your trailer record always of the same structure in all the 3 files? If so, you can declare a new structure as follows and insert this code in your subroutine where you upload the file, after the records are appended to itab_file.
data: begin of wa_trailer,
        rec_type,
        count(10) type n,
        field1(?) type c,
        field2(?) type c.
data: end of wa_trailer.
Now in your subroutine, after itab_file is filled up insert this code
describe table itab_file lines v_rec_count.
v_rec_count = v_rec_count - 1.
read table itab_file into wa_trailer index v_rec_count.
if v_rec_count <> wa_trailer-count.
error.
endif.
Here I am assuming that the count 20 you have is not including the trailer record. If it is also included, then remove the "v_rec_count = v_rec_count - 1." sentence.

Similar Messages

  • Who has changed the Custom Field value?

    Dears,
    Need to know the information regarding how to fetch that who has changed the Custom field value from PWA/MPP.
    Example:
    There is a PDP (say ProjectInfo):
    There is a Custom Field added to that PDP (say Project Status = In Progress).
    Now for ProjectA, someone has checked out and changed the Custom Field "Project Status" from "In Progress" to "Closed".
    I need to fetch the information regarding who has changed that Custom field.
    In which direction should I move: Event Handlers, PSI???? Any other stuff?
    Thanks & Regards,
    Shravan

    Hi Shravan,
    I'm not a developer but I do know that you can use an event handler pushing the resource name and date in custom fields.
    Another way is to use a 3rd-party tool like
    FluentPro Audit Tool.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • Set the default field value to transaction code field, when calling from WD

    Hi all,
    Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
    Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
    Is there any way to set the default field value to transaction code field, when calling from WD?
    Please suggest, if anyone have any idea.
    Thanks
    Sanket

    Hi,
    I am using the below code to open a standard transaction. It will help you to explain my point more easily.
    DATA: url TYPE string,
              host TYPE string,
              port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
       INTO url.
    *get the window manager as we are opening t code in external window.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Note*
    One more query I want to add to this thread, that is there any possibility to call a custom transaction as well?

  • Urgent: move the created_by field to preq_name for PR in srm

    Hi All ,
    I need to move the created_by field into preq_name field when creating Shopping cart in SRM the backend PR will create .
    I need it urgently..
    Thanks in Advance,
    Prashnath.

    Hi,
    You can try to create a new standard view, then select “created by” and “modified by” column under columns, next apply this view, finally check the effect.
    Did you customize the permissions of the list or document library? Did you customize the permission of the item? For example, break the permission inheritance form its parents. If so, try to inherit permission from its parents, after that create a new standard view according to the steps above, then check the effect.
    By default, permissions on lists, libraries, folders, items, and documents are inherited from the parent site. However, you can break this inheritance for any securable object at a lower level in the hierarchy by editing the permissions on that securable object (that is, creating a unique permission assignment) . For example, you can edit the permissions for a document library, which breaks the permissions inheritance from the site.
    You can also try to create a new document library, then create a new document with user A, after that log into with user B, check the effect.
    For more information about  SharePoint : page level permissions, please refer to the following article:
    SharePoint : page level permissions
    http://blogs.msdn.com/brettrobinson/archive/2009/04/24/sharepoint-page-level-permissions.aspx
    For more information about control access to sites, please look into the following articles:
    About controlling access to sites and site content
    http://office.microsoft.com/en-us/sharepointtechnology/HA101001441033.aspx
    Permission levels and permissions
    http://office.microsoft.com/en-us/sharepointtechnology/HA101001491033.aspx
    For more information about how to create a view, please refer to the following article:
    Create or change a view
    http://office.microsoft.com/en-us/help/HA100215771033.aspx
    Hope this helps.
    Rock Wang
    Rock Wang– MSFT

  • How to pass the FORM Fields value by Form Personalization

    Hi ALL,
    I want to pass form filds values in to procedure. I am calling this procedure through form personalization of that form..... But it's not accepting any form field's value there... when i am passing hardcoded vales procedure is executing fine...
    can any one suggest what to do???
    i tried with these syntax
    TEST_EMP_FP(:ADDR.ADDRESS_ID,'ABC')
    TEST_EMP_FP(${item.ADDR.ADDRESS_ID.value},'ABC')
    Regards
    Ravi

    Hi,
    Iam calling an SRS from forms personlization. Can any body tell me how to pass the Form field values as parameters to the Reports. (Example when they call this Concurrent request from Transact5ions screen, The invoice number should be defaulted in the report parameter).
    Regards,,
    Anil.

  • IRecruitment Create Vacancy: Move the Position Field

    Hello all,
    I was wondering if anyone knows how or if we can move the position field on the Create Vacancy: Vacancy Details page. We are unable to reorder the page using personalizations and we are strictly avoiding customizations, but the position field is in place where it just doesn't make sense.
    In some cases, users will select a position, which populates the job, organization and location fields. But on the page it is after all of these fields, which doesn't make sense. Also, the position LOV is empty if org and location are already selected. We can get around this by selecting position first, but it is 10th or so field on the page.
    Does anyone have any ideas on how we can accomplish this without customization? I don't think it is possible, but I thought I would get some feedback first.
    Thanks,
    Mark

    Dear Charlie,
    Thanks for your reply, but i still have the same problem.
    Actually i am creating new rule with the below conditions:-
    Category : For Your Information
    Conditions:
    VACANCY_INSERT_OR_UPDATE in (INSERT)
    VACANCY_RULE_TYPE in (CUSTOM_RULE)
    Action:
    approval-group chain of authority                    Require approval from HR Africa Coordinators
    Actually this rule is working fine and sending notification but my problem is that when creating the vacancy, its saying that vacancy submitted for approval which is wrong, i needed it to be created automatically.

  • How to Print the same field value in a single row

    Hi,
    I need to print the same field values in a single row
    For Examble
    in a table TestTable
    ID Name Value
    1 AB 120
    1 BC 150
    1 CD 130
    2 AB 111
    2 BC 112
    2 CD 113
    I need the query like if the Name contains BC and CD then i need to print like ID, BC Value, CD Value as below
    ID BC'Value CD'Value
    1 150 130
    2 112 113
    Kindly suggest me...
    Thanks in Advance
    Anu

    Hi,
    Since you're on 9i some available functionality unfortunatly isn't at your disposal.
    This should work, however, using your sample data:
    MHO%xe> create table t as ( -- generating sample data:
      2  select 1 cid, 'AB' cname, 120 cvalue from dual union all
      3  select 1, 'BC', 150 from dual union all
      4  select 1, 'CD', 130 from dual union all
      5  select 2, 'AB', 111 from dual union all
      6  select 2, 'BC', 112 from dual union all
      7  select 2, 'CD', 113 from dual
      8  );
    Tabel is aangemaakt.
    MHO%xe> select cid
      2  ,      max(decode(cname, 'BC', cvalue, null)) BC_value
      3  ,      max(decode(cname, 'CD', cvalue, null)) CD_value
      4  from   t
      5  group by cid;
           CID   BC_VALUE   CD_VALUE
             1        150        130
             2        112        113For reference and future challenges, see:
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:419593546543
    http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php

  • How can you trim the contact field value without cloudconnector?

    How can you trim the contact field value without cloudconnector?

    You can add your contacts to segments, while right-clicking on the criteria you have added in segments, you will see the option for Merge, Intersect & Trim.
    See the attached URL, it might help you .
    Merge, Intersect, Trim

  • Mobile Code Signing Certificate - The publisherId field value is invalid.

    Hi,
    I have registered with MS and I am trying to obtain the Symantec certificate.  I have pasted my publisher ID e.g. CN=5gv5
    etc into the field and entered my primary email associated with the account, however it says:
    The publisherId field value is invalid.
    I have had a phone call confirming the details, so I'm not sure why this error is flagging, any ideas?  Is there anyway of contacting someone to chase this up?
    Thanks, Matt.<o:p></o:p>

    The publisher ID is currently a 7 digit number which was missing from our dashboard.  Symantec support cleared up through our preferred supplier.

  • How to validate the incoming field value and raise an alert message

    Dear all,
    I have the following structure
    If incoming value for the field externalid is empty then i have to raise a alert message to end user "externalid field is empty for the id : id number" and for all incoming values it should work. I used the following udf on field externalid with two arguments
    if(externalid.equals(""))
    throw new RuntimeException("externalid field empty for the following id : " +id);
    else
    return externalid;
    This is working fine for single record. But for many records(multiple occurences), this logic is not working as if records 2 and 3 fails it is showing exception externalid field is empty for the id : record 2.
    how to achieve the tranformation logic ?
    Regards
    Koti Reddy

    Hi Amit,
    I have tried the above udf, but still stuck-up.
    For the above structure shown in image, i have tested giving the following payload
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:upsertRequest xmlns:ns0="http://sap.com/xi/SFIHCM01">
       <sessionId/>
       <upsert>
          <type/>
          <sfobject>
             <id>1</id>
             <businessKeys>1</businessKeys>
             <type>1</type>
             <status>1</status>
             <externalId>1</externalId>
             <username>1</username>
             <firstName>1</firstName>
             <lastName>1</lastName>
             <mi>1</mi>
             <gender>1</gender>
             <email>1</email>
             <managerExternalId>1</managerExternalId>
             <hrExternalId>1</hrExternalId>
             <department/>
             <jobCode/>
             <division/>
             <location/>
             <timeZone>1</timeZone>
             <hireDate/>
             <empId/>
             <title/>
             <businessPhone/>
             <fax/>
             <addressLine1/>
             <addressLine2/>
             <city/>
             <state/>
             <country/>
             <zipCode/>
             <reviewFreq/>
             <lastReviewDate/>
             <matrixManagerExternalIds/>
             <defaultLocale/>
             <customManagerExternalIds/>
             <secondManagerExternalId/>
             <loginMethod/>
             <proxy/>
          </sfobject>
          <sfobject>
             <id>2</id>
             <businessKeys>2</businessKeys>
             <type>2</type>
             <status>2</status>
             <externalId>2</externalId>
             <username>2</username>
             <firstName>2</firstName>
             <lastName>2</lastName>
             <mi>2</mi>
             <gender>2</gender>
             <email>2</email>
             <managerExternalId>2</managerExternalId>
             <hrExternalId/>
             <department/>
             <jobCode/>
             <division/>
             <location/>
             <timeZone/>
             <hireDate/>
             <empId/>
             <title/>
             <businessPhone/>
             <fax/>
             <addressLine1/>
             <addressLine2/>
             <city/>
             <state/>
             <country/>
             <zipCode/>
             <reviewFreq/>
             <lastReviewDate/>
             <matrixManagerExternalIds/>
             <defaultLocale/>
             <customManagerExternalIds/>
             <secondManagerExternalId/>
             <loginMethod/>
             <proxy/>
          </sfobject>
          <processingParam>
             <name/>
             <value/>
          </processingParam>
       </upsert>
    </ns0:upsertRequest>
    No node is creating for success records, instead it throws exception that "externalid field is missing for the id": id     for empty externalid field value in second record.
    But my requirement is..... when i process 50 records, records with missing value for field externalid should raise an alert message to end user intimating him to check the externalid field for particular id. If the value for externalid field is present in incoming record/payload, then it should be passed to target system.
    How can i implement this logic ?
    Regards
    Koti Reddy

  • Not able to get the taxonomy field value of meta data field type

    Hi Everyone,
    Not able to get the taxonomy filed value from the metadata filed type.
    Any one can help me on this.
    Label, TermGuid, ValidatedString are showing empty when i debug the code.
    Below is the code which i used to get the taxonomy filed value

    Hi,
    Can you please try getting this way?
    var taxonomyField = listItem.Fields.GetFieldByInternalName(fieldName) as TaxonomyField;
    if (taxonomyField.AllowMultipleValues)
    var fieldValuesCollection = listItem[taxonomyField.Title] as TaxonomyFieldValueCollection;
    return fieldValuesCollection.Select(x => new Guid(x.TermGuid)).ToList();
    else
    var fieldValue = listItem[taxonomyField.Title] as TaxonomyFieldValue;
    return new List<Guid>() { new Guid(fieldValue.TermGuid) };
    Hope it helps!
    Thanks,
    Avni Bhatt
    If this helped you resolve your issue, please mark it Answered

  • Subtotal in alv report based on the particular field value

    Hi,
    As per my requirement, i need to do subtotal of quntity field based on the material number field value in alv report.
    Ex:  if material number falls 1 to 10 then i need to be calculate and display subtotal qty amount with text " total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with text "total of the mat2". similarily i need to display the details.
    <removed_by_moderator>
    Regards
    Nagendra

    Hi,
    Ex: if material number falls 1 to 10 then i need to be calculate and display subtotal qty amount with text " total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with text "total of the mat2". similarily i need to display the details.
    What you can do is in your output table, you will have to create an auxilary field, lets call it as material group (groupid). Now you can do a subtotal on the material group. However the logic to determine what materials belong to which group should be coded. I guess you might be having some logic for that.
    So lets say that material 1 to 10 as G1 ( group 1 ) and material 11 to 20 as G2 ( group 2 )
    The output of the internal table would be
    Groupid  matnr ...
    1  1
    1  2
    1  3.....and so on
    2  11
    2  12
    2  13....upto 20.
    Now in the fieldcatalog assign an 'X' to the 'dosum' parameter to the field Groupid
    In the sort info do the following :
    gs_sort-fieldname = 'GROUPID'.
    gs_sort-spos = 1.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT****
    append gs_sort to gt_sort.
    Now pass all this data to the alv grid function. And you are done.
    regards,
    Advait

  • Html select change to make JSP page forward keeping the exsting field value

    Hello, All,
    I am trying to make the change of a selection box in HTML form to reload the page and populate the second selection box based on the value in the first selection box. The content of the second selection box is from database....
    i used a javascript funtion and called it by the onChange(), the onChange redirect the page to the same page. However all my previous input is lost and the second selection box is not populated based on the first selection box.
    The question is how do I keep the current input and reload the page based on the change of a selection box?
    Please help..
    Thanks..
    Here is the code
    <script language=javascript type="text/javascript">
    function forward(){
    location.href="trdCapDetail.jsp";
    </script>
    <select name=vehicle onChange="forward()">
    <%for(int i = 0; i < Vehicle.getAll().size(); i++){
         Vehicle vehicle = (Vehicle)(Vehicle.getAll().elementAt(i));     
         out.write("<option value=" + vehicle.getKey()+" >" + vehicle.getCode() + "</option>");
    %>

    Ok two things.
    1 - you need to submit the value which was selected.
    2 - you need to repopulate the select box with it.
    1 - you need to submit the value which was selected.
    You do this by either appending the parameter to the url, or calling form.submit().
    <script language=javascript type="text/javascript">
    // either set parameter on url manually
    function forward(control){
    var param = control.value;
    location.href="trdCapDetail.jsp?vehicle=" + param;
    // or submit the form:
    function forward(control){
      control.form.submit();
    <% pageContext.setAttribute("vehicles", Vehicle.getAll() ) ; %>
    <form name="myForm" action="trdCapDetail.jsp"> 
      <select name="vehicle" onchange="forward(this)">
          <c:forEach var="vehicle" items="${vehicles}">
            <option value="<c:out value="${vehicle.key}"/>"> <c:out value="${vehicle.code}"/> </option>
          </c:forEach>
       </select>   
    </form>2: populating the control
    One way is to use javascript again:
    <c:if test="${not empty param.vehicle}">
      <script language="javascript">
        document.myForm.vehicle.value = "<c:out value="${param.vehicle}"/>";
      </script>
      </c:if>
    // or scriptlet code if you must
    <%
    String selectedVehicle = request.getParameter("vehicle");
    if (selectedVehicle != null){  %>
      <script language="javascript">
        document.myForm.vehicle.value = "<%= selectedVehicle%>";
      </script>
    <%
    %>The other way to keep the current input is to generate the string "selected" inside the option tag for the selected item. In your loop, check if the current id equals the submitted id, and print "selected" if it is.
    Hope this helps,
    evnafets

  • How to update the Customer field value of PO Item under the Delivery Address Tab?

    Hi Friends,
         i tried to update the Customer field Using Bapi_PO_change.I passed the PO Order no,POADDRDELIVERY data with Item no,Adrees no,Customer no.But i am getting no data changed message from return table.I attached the screen shots.So please suggest me the helpful information for resoving this issue.
    Thanks,
    Dinesh

    Thank you friends,
                My Problem was resolved.In my case i have passed the customer value in BAPI_PO_CHANGE POITEM Table with updated customer value.
    Thanks,
    Dinesh

Maybe you are looking for