F4 Help on one field should populate data on another field

Dear All....
I am using the FM - F4IF_INT_TABLE_VALUE_REQUEST for F4 help on one field of the selection screen. Based on the selected value, a values corresponding to it should appear on another field.
My Code -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_svn.
  SELECT qmnum serialnr
    INTO TABLE t_qmel
    FROM qmel
    WHERE qmart  = 'ZD'.
  SORT t_qmel BY qmnum.
Display the f4 Help Values for SVN
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield     = 'QMNUM'
      dynpprog     = sy-repid
      dynpnr       = sy-dynnr
      dynprofield  = 'P_SVN'
      window_title = text-015
      value_org    = 'S'
    TABLES
      value_tab    = t_qmel
      return_tab   = t_retval.
  READ TABLE t_retval INTO w_retval_wa INDEX 1.
  IF sy-subrc = 0.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        input  = w_retval_wa-fieldval
      IMPORTING
        output = w_qmel_wa-qmnum.
    w_retval_wa-fieldval = w_qmel_wa-qmnum.
    READ TABLE t_qmel INTO w_qmel_wa WITH KEY qmnum = w_retval_wa-fieldval
                                     BINARY SEARCH.
    IF sy-subrc = 0.
      p_esn = w_qmel_wa-serialnr.
    ENDIF.
  ENDIF.
But this is however not working.
Please let me know where I am going wrong.
I have serached SDN thoroghly but could not get my solution.
Please guide me....
Regards,
Pankaj Agarwal.

*&  AT SELECTION SCREEN ON VALUE-REQUEST FOR FIELD
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_ebeln.
  PERFORM f4_hlp_ebeln.
*&      Form  F4_HLP_EBELN
      text
-->  p1        text
<--  p2        text
FORM f4_hlp_ebeln .
  TYPES: BEGIN OF ty_ebeln,
           ebeln TYPE ebeln ,
        END OF ty_ebeln.
  DATA: lt_ebeln TYPE TABLE OF ty_ebeln.
  CLEAR: lt_ebeln[].
  SELECT ebeln
       FROM zmt_po_mic_ded
         INTO TABLE lt_ebeln.
  IF sy-subrc = 0.
    SORT lt_ebeln[] BY ebeln.
    DELETE ADJACENT DUPLICATES FROM lt_ebeln COMPARING ALL FIELDS.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
        retfield         = 'EBELN'
        dynpprog         = sy-repid
        dynpnr           = sy-dynnr
        dynprofield      = 'P_EBELN'
        value_org        = 'S'
        callback_program = sy-repid
      TABLES
        value_tab        = lt_ebeln[]
      EXCEPTIONS
        parameter_error  = 1
        no_values_found  = 2
        OTHERS           = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
  ENDIF.
ENDFORM.                    " F4_HLP_EBELN
DATA: t_dynfields TYPE TABLE OF dynpread,
      t_valhlp    TYPE TABLE OF ty_valhlp.
DATA: w_dynfields TYPE dynpread.
CLEAR: t_dynfields[], t_valhlp[].
  DATA: l_ebeln TYPE ebeln.
  w_dynfields-fieldname = 'P_EBELN'.
  w_dynfields-fieldvalue = p_ebeln.
  APPEND w_dynfields TO t_dynfields.
  CLEAR w_dynfields.
  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = sy-dynnr
      translate_to_upper   = c_x
    TABLES
      dynpfields           = t_dynfields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  READ TABLE t_dynfields INTO w_dynfields INDEX 1.
  IF sy-subrc = 0.
    l_ebeln = w_dynfields-fieldvalue.
    SELECT ebeln
           ebelp
           FROM ekpo
           INTO TABLE t_valhlp
           WHERE ebeln = l_ebeln.
    IF sy-subrc = 0.
      SORT t_valhlp[] BY ebeln ebelp.
here we get the value of ebelp depending on the selection of EBELN ***
    endif.
  ENDIF.

Similar Messages

  • Fill in fields based on response in another field.

    Is there a way to use one field to automatically fill in another field?  For example, I have two fields (Project Name & Project Address).  Project Name is a pull down menu.  Can I have Project Address automatically fill in based on their choice of Project Name?
    Thanks,
    Mike

    Check the following link , you may get an idea to solve your problem
    mapping an EO to a view ?
    -Krishnamurthy

  • Seeking Pdf form help - javascript formula to auto-populate fields based on data from other fields.

    Hi there, I am new to PDF form work, and am wondering if someone could help me with a javascript formula.
    I want to auto-populate the EXPIRYDATE field, as the same date as the entered AUTHORIZATIONDATE field, but 4 years later.
    So, I want to be able to enter 11/14/2014 in the AUTHORIZATIONDATE date, and have 11/14/2018 auto populate in the EXPIRYDATE field.
    Seems simple I know, but I've messed around quite a bit and can't seem to make it work. Is this possible??
    Any help would be very much appreciated!!

    And what have you done?
    This can only be done with custom JavaScript programing.
    The value of date type fields are text field and not numeric data. The first task is to convert the dates to a number on some type of number sequence that is a mapping to dates.
    Have you looked at the Acrobat JavaScript API Reference, the MDN JavaScript reference?
    I would use the Acrobat JavaScript util.scand to covert the date string to the number of milliseconds from January 1, 1970 midnight. and then use the getFullYear method of the date object for the year value and add 4 years to that value and then use the setFullYear method to set the year for the date object. Now you can use the util.printd method to format the date object as a date string with a specific format.
    // get the date value, format of date string and years to add;
    var cDate = "11/14/2014"; // date value;
    var cFormat = "mm/dd/yyyy"; // date format;
    var nYears = 4; // years to add;
    // convert date string to date object;
    var oDate = util.scand(cFormat, cDate);
    if(oDate == null) {
    app.alert("Error converting " + cDate + " using format " + cFormat, 0, 1);
    // add years to date object;
    oDate.setFullYear(oDate.getFullYear() + nYears);
    // display result;
    var cExpireyDate = util.printd(cFormat, oDate);
    app.alert("Authorization Date: " + cDate + "." +
    "\nExpire Date: " + cExpireyDate, 3, 0);

  • How to populate data for a field in data source

    Hi
      I have a field(VGBEL) in the data source 2LIS_11_VAITM, but i do not have data in it. I will have to populate data into it for that, I guess i need to write some  ABAP code .My question is where should i write the code.
    P.S If I have to write in the functional module or user exit how do i know the relavent functional module or user exit for the particular data source
    Thanks
    Sheetal

    HI sheetal,
    there will not be different user exit for each datsource. check this thread for the steps, which are general for any datsource.
    How to enhance datasources
    How to Data source enhancement i.e Transactional data
    you need to write your code in function module EXIT_SAPLRSAP_001 .
    hope it helps
    Regards
    Kiran
    *do assign points for helpfull answers.
    Message was edited by:
            ravi kiran naalla

  • ABAP code needed to populate data in the fields............

    Hi,
    I have added 3 new fields to the datasource 0PROJETC_ATTR
    fields names are : ZZPROFL , ZZPLFAZ and ZZPLSEZ
    Can some body tell me the ABAP code to fill data in these 3 fields.
    Thanks,
    Jeetu

    hi Jeetu,
    we need the logic,
    but the code will something like following sample ...
    Declaration for datasource 0MATERIAL_ATTR
    DATA : BEGIN OF S_BIW_MARA_S.
    INCLUDE STRUCTURE BIW_MARA_S.
    DATA : END OF S_BIW_MARA_S.
    *Here BIW_MARA_S corresponds to the structure of your datasource *0MATERIAL_ATTR
    *then you have to declare a when with the datasource on which you want to *populate the appended new fields.
    *for example :
    WHEN '0MATERIAL_ATTR'.
    *then do a loop across your strcuture
    LOOP AT C_T_DATA INTO S_BIW_MARA_S.
    *a select from the table
    SELECT SINGLE * FROM MARA
    WHERE MATNR = S_BIW_MARA_S-MATNR.
    *a check to see if your select is ok
    IF SY-SUBRC = 0.
    *if it is ok then your field in your structure is corresponding to a field in the table
    S_BIW_MARA_S-Z1 = MARA-Z1.
    S_BIW_MARA_S-Z2 = MARA-Z2.
    *the c_t_data will be updated from what you get in your structure.
    MODIFY C_T_DATA FROM S_BIW_MARA_S.
    ENDIF.
    ENDLOOP.
    hope this helps.

  • Populate data into customise field in the line item of FB60

    Hi,
    Does anyone know which BAdI/User Exit/ Implementation that i can use for populating data into the customize field in the line item of FB60?
    Thanks in advance.

    Hi,
    I have found the module to implement. But i met with one problem which is I edit the data for customise field, and modify the table xbseg. I don't know why until the point which it is needed to cast it to the screen, the data that i derived for my customise field is being deleted. Any idea why is it so?

  • Data in one field requires data in another field

    I am trying to build a form that forces data entry (text)
    into a field if a previous ( or other ) field has data in it.
    Example: If there is data in the "Full Name" block, you have
    to put data in the "Crew Name" block.
    If the "Crew Name" block contains data, all is fine,
    otherwise an error message is created.
    Also, how do I validate this ( is it even required ? )
    Thanks ! ~The Noob~

    Droto wrote:
    > I am trying to build a form that forces data entry
    (text) into a field if a
    > previous ( or other ) field has data in it.
    > Example: If there is data in the "Full Name" block, you
    have to put data in
    > the "Crew Name" block.
    > If the "Crew Name" block contains data, all is fine,
    otherwise an error
    > message is created.
    > Also, how do I validate this ( is it even required ? )
    > Thanks ! ~The Noob~
    >
    Are you saying that "Full Name" is not required? But if there
    is data in
    the "Full Name" field, then "Crew Name" is required?
    Mick

  • Numeric format based on data in another field

    I am trying to set up a form where the numeric format of one field is based on units of measure in another field. The fields are: units1 and iq1. What I want to do is have the iq1 field format for percent with two decimal places when units1 is  LS or ls or L.S. or l.s. otherwise the field should be formatted for a number with the format nnn,nnn,nnn.nn. Any help for this newbie is appreciated.

    I think this is what you are looking for:
    Make sure that you select "Commit selected value immediately" in the options tab of the drop down menu.
    //Place this script in the custom validation script of the drop down menu
    //Create a text field caleld Text2
    var MySelection = event.value;
    switch (MySelection) {
    case "Accountability":
        this.getField("Text2").value = "Accepts personal responsibility for the quality and timeliness of work. Can be relied upon to achieve results with little need for supervision. ";   
    break;
      case "Compliance":
        this.getField("Text2").value = "Complies with policies, procedures, workflows and instructions.";
        break;
    I hope this helps.

  • How can i make it where if data is entered into a field it is mirrored to another field within the document?

    I do not want them named the same as I don't want the second one appearing until after it is entered into the first field.

    Hi,
    If the form fields have the same name then the data entered in one field will be auto populated in other with the same name. For example, if there is a form field named custom field 1 in one document and there is another field with the same name(custom field 1) in the other document and you upload them together into a single transaction and send the document, then the data entered in custom field 1 in one document will be auto populated in custom field 1 of other document as well. This also applies for one document only as well.
    Does this help?

  • How to display f4 help for a field based on value of another field

    Hello All,
    I have 4 fields : Sales Org : VBAK-VKORG, Distrib Channel : RV50A-VTWEG, Div : RV50A-SPART, Sold-to-party : KUAGV-KUNNR.
    The second field depends on the first one, the third on the second one and the fourth on the first field.
    However, when each of the second third and fourth fields' f4 help is displayed, the values are independent of the previous fields. How do I set the f4 help to display values based on the respective fields?
    Regards,
    Mithun

    Please be sure that you are searching the forums before posting. This exact same question was asked just yesterday:
    F4 help to input field
    In particular study the section and the linked help document for ddic search helps export/importing parameters and the requirements for DDic Structure/table usage for the parameter mapping.

  • Values of one column in one sheet should reflect in the another column

    Hi,
           We have a workbook where the same column values in one sheet should reflect in the column values of different sheet.
    Can anyone please provide a solution to this.
    Thanks & Regards
    sravan kumar

    Use the simple Excel formula of equal to and give reference to that column or try using a VB Macro.
    Regards,
    Sachin Shetty

  • Change value in a field and reflect value of another field

    Hi all,
    I have a situation here where in the Single Customer View, under the Completed Task. When I changed the value of a field name called Status to "Completed" in the Edit screen and I save it, another field that is in the same screen called "Completed Date" will auto populate the current date as value. may I know how do I achieve this?
    Thanks and appreciate for help
    Regards,
    Anson

    Hi !
    You've got to create a workflow rule on Activity with the event trigger Before modified record saved.
    The condition will be like this :
    *&#91;&lt;Status&gt;&#93;=LookupValue("EVENT_STATUS", "Completed") AND &#91;&lt;Status&gt;&#93;&lt;&gt;PRE('&lt;Status&gt;')*
    Then the action of this rule will update the field *"Completed Date"* with the value Today().
    But you don't have to do it for the completed date field, because it's already filled automatically when you change the status to completed.
    Hope this will help, feel free to ask more !
    Max

  • Show / hide field based on text in another field

    Hi,
    I'm trying to make one of my fields reactive to what is the text generated in another field.
    At the moment I have this under calculate using custom javascript:
    var Mask = this.getField("Course").value;
    if(Mask == 'Swimming') this.getField("Code").display = display.visible;
    else this.getField("Code").display = display.hidden;
    Whereas Course is the field that is changing and Code is the one that will show/hide based on content of Course.
    Any help?

    Hi Everyone,
    After doing trials with simple calculations it still wasn't working and so I've figured out what the problem is - the document was being exported but with the data being pre-populated from an SQL database in which during the export it all happens at once, not a chain effect so when the export happens it was filling "Code" before "Course" had any info in it...
    The fix was basically having to create a different field in the SQL source itself for an independent field on the pdf form.

  • 10.1.3--Disable a field according to values of another field.

    Hi,
    I am trying to set a filed on the JSP to be disalbed according to values of another field.
    eg. When the value in "ID" field is NOT 10 or 20, the "Bill" field should be disabled.
    I have tried using only one condition which is when "ID" != 10 or "ID" != 20. They work fine. But when I try to combine two conditions together using "&&" sign, I got a syntax error. The JSP does not display at all. I asked an expert about it, the answer is:
    #{(bindings.Deptno.inputValue.value !=10) &&(bindings.Comm.inputValue.value > 1000)}. I tried this on my application and got the same syntax error.
    Has anybody had a similar situation? Any idea what could be wrong? Thanks in advance.
    Annie

    Hi bsalvador,
    I've had a simular situation once where I needed to make items disabled or required depending on a workflow step and on depending on other page items. Basically the disabling of items is done by javscript, keep in mind that readonly is not the same as disabled. When you use readonly, the item can still be manipulated with javascript. When you disable an item, the item is not even submitted to the database, so you have to make sure that your submit process can hadle that.
    There are two different situations:
    First you have the page load / page submit, there you can use PL/SQL to check which items should be submitted, hand them a javascript class or make them readonly/disabled straight away.
    Second you have a situation where you want to disable certain items depending on the value of other items. This is done 'on the fly' and should be handled with a javascript function.
    Keep in mind however that javascript runs client side and isn't a secure way to handle data integrity, so you would need a database process to validate which items need to be submitted as well.
    Regards,
    Vincent Deelen

  • Automatically fill in field from first letter of another field

    Hi,
    I have a situation where i would like to fill in a field automatically, dependant on the first letter entered in another field.
    Here's some examples:
    1. Field one - A6805B  Field two - 'UHF' (As A = UHF)
    2. Field one - E1234C  Feild two - 'VHF' (As E = VHF)
    3. Field one - S5673D  Field two - 'Error - No Frequency' (As S doesn't have an equivalent)
    Can anyone help?
    Cheers
    Rob

    Hi Rob,
    You can do this by assigning the first letter to a variable and then testing that variable.
    A sample is here: https://acrobat.com/#d=OoLUPLu1Qy1*8Uxz7*hG6Q
    Hope that helps,
    Niall

Maybe you are looking for

  • Reporting on BEX Query in WEBI 4.0

    Hi , I am new to 4.0 we are created webi reports based on the Bex queries with out universe.. can any one share me the documents or links  webi Bex queries ,what is possibility's and customization in the webi level. Thanking you Advance Regards, G

  • Configuration of WPA on D-link DSL-604T

    I'm using my Mac BookPro to configure my new modem (D-Link DSL-604T)and it all works fine, but when i try to set WPA it won't save the changes. I've followed the instructions to the letter, do i have to use a PC to configure it. As it is at the momen

  • Best practice recommendations for Payables month end inbound jobs

    During Payables month end we hold off inbound invoice files and release them once the new period is open so that invoice get created in new fiscal period. Is this an efficient way to do? Please advise best practice for this business process. Thanks

  • My mouse cursor disappears and does not come back when the mouse is moved.

    Ocassionally my cursor disappears, usually when the display has gone to sleep.  The mouse is still working because I can "mouse over" places on the screen, they are highlighted, and click on items, but there is no cursor.  Fortunately, I can usually

  • Using Windows API in Java

    hi, How can i use windows api in java. regards Malik Faisal