How can I execute program after using F4_Filename function?

Hi all,
I'm a new user on the forum. I've been working with ABAP and SAP for a few weeks. I wrote a program for importing data from excel file to SAP using BDC. During searching this forum I found information about F4_Filename function which allows users to browse the disc for a file. I'd like to add this function to my program. I have a parameter for a file name but this is an ordinary static string field. When I added the code which I found in the message on this forum the rest of program doesn't execute.
This is simple program for example:
REPORT  Z_TEST8_AB.
DATA f_name TYPE STRING.
PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
f_name = p_file.
write:/ f_name.
This program works correctly. There is a field for parameter. I can change the default name for a file.
After all, I can run the program (F8) and rest of the code is executed. The field for parameter dissapears from the screen and the file name is displayed. ( command write)
Now I added a function F4_Filename
REPORT  Z_TEST8_AB.
DATA f_name TYPE STRING.
PARAMETERS p_file like rlgrap-filename DEFAULT 'c:\test.xls'.
at selection-screen on value-request for p_file.
  call function 'F4_FILENAME'
       exporting
            program_name  = syst-repid
            dynpro_number = syst-dynnr
            field_name    = 'p_file'
       importing
            file_name     = p_file.
f_name = p_file.
write:/ f_name.
I can browse a computer for a file now but after selecting the file I can't run the rest of the code. When I click on the icon or press key F8 the field for parameter doesn't dissapier and the command write is not executed.
What do I do wrong?
Could anyone suggest me a solution? How can I executed the code after using this function?
Thanks in advance.
Regards,
Arek.

Hi arkadiusz,
1. simple
2.
<b>start-of-selection.</b>
f_name = p_file.
write:/ f_name.
regards,
amit m.

Similar Messages

  • How can i execute a workflow using a bapi/wapi??

    Hi All,
    How can i execute a workflow using a bapi/wapi??
    pls advice
    thanks

    Hi Hrus,
    it's not as simple as a single BAPI to approve a workflow.
    Workflow comes with a Workflow API (WAPI) that you can use to programmatically interact with the workflow system. The WAPI is implemented as a group of RFC-enabled function modules that are prefixed with "SAP_WAPI_".
    Approving a workflow is simply taking a decision path for a workflow item. It is logically no different to rejecting the same workflow item or any other workflow decision.
    As part of NetWeaver workflow is tightly coupled to the WAS platform you are running on so you may need to perform WAPI operations slightly differently on older releases.
    Some of the WAPI calls you might need to use include: -
      SAP_WAPI_GET_HEADER to get the workitem header
      SAP_WAPI_READ_CONTAINER to get the workitem container
      SAP_WAPI_GET_OBJECTS to get the attached objects
      SAP_WAPI_DECISION_READ to get a list of possible decisions
      SAP_WAPI_SET_WORKITEM_STATUS to set the workitem status
      SAP_WAPI_WRITE_CONTAINER to write to the workitem container
      SAP_WAPI_EXECUTE_WORKITEM to execute the workitem
    I usually do what you are trying to do by adding the decision to the workflow container and then executing the workflow.
    Be warned, you can really stuff things up if you get this wrong! Make sure you know what you are doing.
    Quoting from Practical Workflow for SAP by Alan Rickayzen, et al from SAP Press...
    Writing directly to the workflow container is dangerous because it can compromise the integrity of the process.
    ...be careful that you do not waste time duplicating existing ad hoc features of SAP's Workflow Engine.
    For example you can use events (combined with wait steps), instead of container modifications to force the workflow to restart.
    Cheers
    Graham Robbo

  • How can I execute a query using RSCRMBW_REPORT?

    Hi everybody,
    I have read the document:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3ba5e590-0201-0010-59b1-cab51fd245b7
    and found it is very intersting for my requirement.
    I copied the report,and modified it regarding our case.But during the second call,I get runtime error.
    I debugged the code, and found the error results from method GET_CUBETYPE() of class CL_RSCRMBW_BAPI.In this method,it tries to create a object which is TYPE REF TO cl_rsd_dta.
    CREATE OBJECT lr_dta
         EXPORTING
           i_infoprov    = g_s_status-infocube
    But g_s_status-infcube is null.
    I am not able to find where this 'infocube' component  in this g_s_status struction is filled,even I found,I don't know how I can give this infocube parameter from report which 2 FM are called.
    My code is following:
    parameters: p_repuid TYPE RSCRMSTATUS-REPORTUID
    DEFAULT 'Z_IC_01/Z_COMP_Q003'.
    parameters: p_split type BAPI6110DIM-DIM_NAM.
    data:name_query TYPE CHAR50,
         result_table LIKE RSCRMSTATUS-TABNAME,
         it_return LIKE BAPIRET2 OCCURS 2 WITH HEADER LINE,
         infocube TYPE CHAR30,
         compid TYPE CHAR30.
    AT SELECTION-SCREEN  ON VALUE-REQUEST FOR p_repuid.
    CALL FUNCTION 'RSZ_COMPONENT_TREE_GET'
        EXPORTING
          i_title    = 'Query auswählen'(031)
        IMPORTING
          E_INFOCUBE = infocube
          E_COMPID   = compid
        EXCEPTIONS
          OTHERS     = 1.
      IF sy-subrc GT 0.
      ENDIF.
    concatenate infocube '/' compid into p_repuid.
    START-OF-SELECTION.
    CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
    i_mode = 'OPEN'
    i_reportuid = p_repuid
    I_PACKSIZE = 10000
    I_EXECMODE = 'TABLE'
    I_EXTRACT = 'ZBWTEST'
    I_SPLIT = p_split
    I_CLEAREXTRACT = 'X'
    TABLES
    E_T_RETURN = it_return.
    CALL FUNCTION 'RSCRMBW_REPORT'
    EXPORTING
    i_mode = 'START'
    i_reportuid = p_repuid
    I_PACKSIZE = 10000
    I_EXECMODE = 'TABLE'
    I_CLEAREXTRACT = 'X'
    TABLES
    E_T_RETURN = it_return.
    So far this creation of report is only the 2nd step.But I am not sure how step 3 to step 6 should be done so that the report can be execute exactly.
    What should I do? Pleas help me!
    Thanks in advance
    Regards,
    Liying
    Message was edited by: Liying Wang
    Message was edited by: Liying Wang
    Message was edited by: Liying Wang

    Liying
    Were you able to get a solution to this problem? I am facing the same issue too. The g_s_status-infocube is showing blank.
    Regards
    Dilip

  • How can HANA Server Side JavaScript use "Eval" function?

    Hi HANA Experts,
      I use EVAL function to create an object by classname in xsjs file, but it has an Error "Eval is evil". In Client javascript, we can use the Eval function. How can we use "EVAL" function in HANA server side javaScript?  Thanks a lot.

    That looks like the client side JSLint check to me.  Those can be customized or even turned off. If you truly want to use eval.
    >XSJS inherits most of the features of javascript but do not expect all of its features
    Actually that's not exactly accurate.  XSJS is standard ECMA JavaScript (Mozilla SpiderMonkey VM).  It does run in strict mode, however. This isn't a limitation of XSJS but a conscious decision to force the VM into the strict mode - which is really the recommendation for JavaScript anyway.  We also apply JSLint checks as above. Sometimes they are quite restrictive. However they can be customized or even completely turned off at the project level:
    To the point of Eval, there are some excellent articles online.
    http://javascriptweblog.wordpress.com/2010/04/19/how-evil-is-eval/
    coding style - When is JavaScript&amp;#39;s eval() not evil? - Stack Overflow
    JSLint Error Explanations - eval is evil

  • How can I register channels imported using DataFileLoad function in DIAdem 2012?

    Hallo,
    I would like to import data from Excel into the DIAdem 2012.
    I newly use DataFileLoad and ufi file to define import plugin.
    But when I want to copy a the imported channels to another group, I get err: The Channel argument of the AddChannel method must be IChannel.
    How can I register/convert/refersh channels, so I can work with them?
    I'm showing code sample I took from standard example collection, from: "Loading Excel Files with a DataPlugin", script file A_172132_ExcelDataPlugin.vbs
    Note: to get to worky my example you have to set proprely used paths
    If Not ItemInfoGet("sPathDocuments") Then
    Call GlobalDim("sPathDocuments")
    Call GlobalDim("sPathData")
    End If
    sPathDocuments = CurrentScriptPath
    sPathData = CurrentScriptPath & "..\Data\"
    call PrepareAndLoadDataset
    sub PrepareAndLoadDataset()
    Call Data.Root.Clear()
    If Not FileFilterExist("A_172132_Example") Then
    Call Navigator.RegisterDataPlugin(sPathDocuments&"A_172132_Example.uri",True)
    End If
    set MyGroup = DataFileLoad(sPathData & "A_172132.xlsx", "A_172132_Example","")
    set MyTemp = Data.Root.ChannelGroups.Add("temp")
    Call MyTemp.Channels.AddChannel(MyGroup.Item(1).ChannelGroups(1).Channels(1))
    end sub
    Thank you for advance.
    Radek
    Solved!
    Go to Solution.

    Hello Codr,
    Your script works fine on with my DIAdem 2012. I just defined "Dim MyGroup, MyTemp"
    The result is a new channel group with one channel. The channel is the first channel of the first group of the loaded dataset.
    In case you would like to register the Excel file (and not load it) you need toexpand the copied channel. This looks like this:
    sub PrepareAndLoadDataset()
    Call Data.Root.Clear()
    If Not FileFilterExist("A_172132_Example") Then
    Call Navigator.RegisterDataPlugin(sPathDocuments&"A_172132_Example.uri",True)
    End If
    dim MyGroup, MyTemp, oChn
    set MyGroup = DataFileLoad(sPathData & "A_172132.xlsx", "A_172132_Example","Register")
    set MyTemp = Data.Root.ChannelGroups.Add("temp")
    set oChn = MyTemp.Channels.AddChannel(MyGroup.Item(1).ChannelGroups(1).Channels(1))
    call ChnValExpand(oChn)
    end sub
    Greetings
    Walter

  • How can I stop the alarm using fingerprint function

    I set two alarm records in my 5s and i was aware. I use fingerprint to stop it but it didn't work and each alarm rang for 15 min. I couldn't stop it. How can i stop the alarm?

    You can either snooze it, or slide to unlock to stop it.

  • How can I compile program which uses packages?

    Hi,
    I'm building a program using JBuilder9. I can successfully run using that IDE, but after I try to run it manually (run class file which compiled from JBuilder) by typing "javac myMainClass" it cannot find serveral packages which I put those packages' folder on the same root directory of myMainClass. Thank you.

    Man, you should probably read the following:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html
    Anyways, the first thing to do is to determine the current value of CLASSPATH (that is a system variable and it depends on your OS how you change/get its value).
    Next thing is to determine WHAT you need to add:
    For each used package check if its (root directory/jar) is in your CLASSPATH. If not add it, e.g.
    - you have a package my.test.package in C:\temp\myJar.jar then add C:\temp\myJar.jar
    - you have a package my.test.package in C:\temp, i.e. your fs structure is C:\temp\my\test\package, then add C:\temp
    For beginners, it's usually a good idea to have your CLASSPATH contain a dot (".") ...

  • How can i execute codedui scripts by using dll

    how Can I Execute Coded UI scripts by using the DLL from anywhere after creating the build 

    Hi yellesh,
    If you mean that you want to run your test with bat file, as far as I know, we could call the MSTEST command line.
    set mstestPath="C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE"
    %mstestpath%\mstest /testcontainer:AutomatedUITest.dll  /resultsfile:TestOutput.trx
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/29af65b3-598b-4205-80e6-35b942113f3b/how-to-run-coded-ui-scripts-trhu-bat-file?forum=vsautotest
    https://social.msdn.microsoft.com/Forums/en-US/42a5d8f2-fe58-4133-b09d-28fa0553ab1a/run-coded-ui-test-in-certain-moment-in-future?forum=vsautotest
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How can i execute vb scripts in java program

    hi
    how can i execute any batch files or any other exe files (vb scripts) from java programs
    thanks

    Hi,
    You use Runtime.exec to execute commands / exe-files. See the documentation (and remember that it will only work on windows):
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    /Kaj

  • How can I execute a batch file from my java program

    Hi,
    Can someone help me or direct me to a link,
    How can I execute a DOS batch file from my java program?
    Thanks

    You will need to grab a handle to the process's
    outputstream so u can see its output.The OP didn't mention any output from any batch file;
    nor any input for that
    matter,so lets not complicate matters here for now
    ok?Actually I think this is essential to see whether it works or not. It's either that or do some manual check to see whether it ran, which is not exactly elegant, and in some cases this may not be easier than simply writing the output stream code, or in fact it may be impossible to check manually.
    I'm sure it wasn't intentional that your post appeared to be bristling with attitude.

  • How can we execute the session in error mode through SE38 program

    Dear Experts,
      How can we execute the BDC session in  error mode through se38 programme....
      we can execute the session in the below 2 ways
    1) Through SM35 we can process the session manually in foreground/Error mode or Background also.
    2) through RSBDCSUB (standared Program) we can process the session in back ground.
    But i want to process the session in foreground or Error mode..Do we have any standared program for process the session in foreground or error mode.
    Please suggest.
    Regards,
    Bussa.

    Hi Bussa,
    Please maintain the mode as 'E' . If there is any errors it will stop else it will run.
    http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInput-+BDC
    http://wiki.sdn.sap.com/wiki/display/ABAP/BatchInputFAQ#BatchInputFAQ-WhySHDBdidn%27trecordsomescreens%3F
    Regards,
    madhu.

  • My dad has the original software and i can't install the program because my dad is in the US and I'm in the Philippines. Now, I asked the serial number of his adobe lightroom. How can I download the software using the serial number? thanks.

    My dad has the original software and i can't install the program because my dad is in the US and I'm in the Philippines. Now, I asked the serial number of his adobe lightroom. How can I download the software using the serial number? thanks.

    If you just need a copy of the software, then download the trial copy of Lr available from Adobe. On entering your serial number it will then become a full copy.

  • Execute program after boot

    Hi,
    I use some Bash scripts to make backups of my data using rsync and cp -l.
    To decide at boot time, if a backup should be made, I append DOBACKUP=yupp (yupp=yes, see problem below) to the kernel line in Grub. The variable DOBACKUP can be accessed within the init environment. I added a simple rc.d scripts that checks if the variable is set and starts the backup. However, this is not the nicest way, since the boot of the system is not finished yet. If the backup script hangs, I don't have any console. How can I execute a program after the computer is booted?
    Furthermore, I don't want to execute the backup script in the background, since it asks for some user input.
    What is the correct way in doing this?
    Another strange behavior occurs, if I set DOBACKUP=yes. In this case, I get a blank screen and not boot output is shown (but it seems that the computer boots correctly, just without any output on the monitor). Thus I use yupp instead of yes to indicate the need for a backup: DOBACKUP=no or DOBACKUP=yupp work both as expected.
    Sven

    falconindy wrote:
    tomk wrote:
    avanc wrote:I don't want to execute the backup script in the background, since it asks for some user input.
    Seems clear to me that you need a logged-in user to provide user input - run the script from your shellrc at login time.
    Either that, or the script should be refactored to not require user input.
    Deamonize the backup script? In that case I don't get any feedback if everything works fine.
    My intention is to install arch on a USB disk. A windows user can plug the disk in and start the computer. Arch Linux is booted from the USB disk and the backup is automatically started. However, a short message that everything worked fine before the script shuts the PC down would be preferable.
    To keep the backup simple, the login idea is also not the best choice...

  • How can I execute external application?

    Hi friends I want printing my barcodes a laser printer (Kyocera) it isn't a barcode printer. So I think (and I look kyocera web page my model doesn't support barcode printing in sap) print my barcodes using an external system. Before SAP we are using JollyPrint application for printing barcodes. It is using an Excel file.
    I can create a excel file for this application. I must execute this (JollyPrint-it is a label application) application when I press a button. How can I execute this application?
    Thanks
    Mehmet
    P.S. I have been writing this message with details may be somebody can give me a simple way for this

    Well, I can suggest you following steps. May be it works for you .
    -Create an external OS command in SM69
    -Test OS command in SM49 ( <u><i>about OS command if you search in SDN you’ll get lot of material</i></u> )
    -Create a Script at your OS level, I’m assuming you might have some UNIX flavor or Sun solaria’s.
    -Create a Shell script , which execute the printer job from OS .
    -Shell script will have parameters . ( e.g. printer name, destination etc )
    -set the path of shell script directory in SM69 ( the command you just created )
    -Execute shell script using your ABAP program ( use FM "SXPG_COMMAND_EXECUTE" )
    In the ABAP  program you can pass the parameters and execute the command from ABAP as a result your job will start printing on the required destination. Moreover, you can also capture the spool at OS level .
    FYI
    For UNIX script, if you search in www.google.com ( UNIX forums) . you’ll get shell script .
    Hope this’ll give you idea!!
    <b>P.S award the points.</b>
    Good luck
    Thanks
    Saquib Khan
    "Some are wise and some are otherwise"

  • How can I execute a statement before a VO is running

    JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660
    I use ADF BC
    how can I execute a statement before a VO is running

    thanks for the answer
    i use a logon function before I run a VO
    after a certain time will be disconnected
    and I have to call the function again
    sorry for my English
    public String logon(String username, String password){
    CallableStatement st = null;
    this.username = username;
    this.password = password;
    try {
    st = getDBTransaction().createCallableStatement("begin ep_security.LogOn(?,?); end;",0);
    st.setObject(1, username);
    st.setObject(2, password);
    st.executeUpdate();
    this.getDBTransaction().commit();
    } catch (SQLException e) {
    System.out.println("ERROR "+e.getMessage());
    this.addWarning(new JboWarning("Quote retrieved successfully"));
    System.out.println("...RETURN ERROR");
    return "error";
    } finally {
    if (st != null) {
    try {
    // 7. Close the statement
    st.close();
    } catch (SQLException e) {
    e.printStackTrace();
    }

Maybe you are looking for