How to capture output when exectuing an external command?

Hey guys,
I am executing the following piece of code:
try {
Process proc = Runtime.getRuntime().exec(execute);
BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
String s;
while ((s = br.readLine ())!= null){
System.out.println(s);
catch (IOException e) {}
Now, I am executing the cmd.exe under Windows 2000 and using it to perform file operations. However, in cases where there is an error message (ie. file does not exist) I do not get any output back on the screen. For some reason it seems to be causing an exception. Does anyone know how I can capture the output or what might be wrong with my current code?
Thanks.

You just captured the "inputStream" There is an error stream too :)

Similar Messages

  • How to capture errors when a Function module is called as BACKGROUND TASK

    How to capture errors when a Function module is called as BACKGROUND TASK?.Please advise.
    FUNCTION ZRPM_DELETE_PROJECT_DATA_API.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(IV_EXTERNAL_ID) TYPE  RPM_TV_EXTID OPTIONAL
    *"     VALUE(IV_PROJECT_GUID) TYPE  RPM_TV_GUID OPTIONAL
    *"     VALUE(FLAG) TYPE  BOOLEAN OPTIONAL
    *"  EXPORTING
    *"     VALUE(EV_RC) TYPE  I
    *"     VALUE(EV_MSG) TYPE  STRING
    *"     VALUE(ET_MSG) TYPE  RPM_TT_MESSAGES
      IF flag = cl_rpm_co=>sc_true.
        Call function 'RPM_DELETE_PROJECT_DATA' IN BACKGROUND TASK
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_RC
            ET_MSG          = ET_MSG.
        COMMIT WORK.
      ELSE.
        CALL FUNCTION 'RPM_DELETE_PROJECT_DATA'
          EXPORTING
            IV_EXTERNAL_ID  = IV_EXTERNAL_ID
            IV_PROJECT_GUID = IV_PROJECT_GUID
          IMPORTING
            EV_RC           = EV_RC
            EV_MSG          = EV_MSG
            ET_MSG          = ET_MSG.
      ENDIF.
    ENDFUNCTION.
    In above code how to capture 'EV_RC' when FM is called as background task.

    Prakash,
    CALL FUNCTION IN BACKGROUND TASK allows no IMPORTING parameters, so that your code will produce a syntax error.
    The calling program can only handle errors of remote function calls (RFC) if these are either
    - synchronous RFC  (that is CALL FUNCTION ... DESTINATION ...) or
    - asynchronous RFC (that is CALL FUNCTION STARTING NEW TASK ... DESTINATION ...).
    Both synchronous and asynchronous RFC allow the capturing of errors by means of exceptions. But that is a different topic.

  • How to capture output of java files using Runtime.exec

    Hi guys,
    I'm trying to capture output of java files using Runtime.exec but I don't know how. I keep receiving error message "java.lang.NoClassDefFoundError:" but I don't know how to :(
    import java.io.*;
    public class CmdExec {
      public CmdExec() {
      public static void main(String argv[]){
         try {
         String line;
         Runtime rt = Runtime.getRuntime();
         String[] cmd = new String[2];
         cmd[0] = "javac";
         cmd[1] = "I:\\My Documents\\My file\\CSM\\CSM00\\SmartQ\\src\\E.java";
         Process proc = rt.exec(cmd);
         cmd = new String[2];
         cmd[0] = "javac";
         cmd[1] = "I:\\My Documents\\My file\\CSM\\CSM00\\SmartQ\\src\\E";
         proc = rt.exec(cmd);
         //BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
         BufferedReader input = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
         while ((line = input.readLine()) != null) {
            System.out.println(line);
         input.close();
        catch (Exception err) {
         err.printStackTrace();
    public class E {
        public static void main(String[] args) {
            System.out.println("hello world!!!!");
    }Please help :)

    Javapedia: Classpath
    How Classes are Found
    Setting the class path (Windows)
    Setting the class path (Solaris/Linux)
    Understanding the Java ClassLoader
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
    javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

  • How to define output types email or external send in the report program

    Hi all,
    now we are using a zprogram for output type printer and standard program RVADOR01 for output type external send. Now i want to modify my zprogram itself to support external send email as well as printer also. What modifications should I have to make in my zprogram. My form is a script.
    Thank you,
    Mallik

    hi all,
    i made the following changes in my code and it worked well.
    thank you for all who tried to share my pain.
    thanks one and all.
    hope this code will help anybode.
    thanks & regards
    FORM OPEN_FORM_EMAIL.
    TABLES: TNAPR,                         "Programs & Forms
            ITCPO,                         "Communicationarea for Spool
            ARC_PARAMS,                    "Archive parameters
            TOA_DARA,                      "Archive parameters
            ADDR_KEY.                      "Adressnumber for ADDRESS
    TYPE-POOLS SZADR.
    DATA: LVF_DEVICE LIKE ITCPP-TDDEVICE,
          LVF_DIALOG(1)     TYPE   C   VALUE ' ',
          LVS_RECIPIENT     LIKE   SWOTOBJID,
          LVS_SENDER        LIKE   SWOTOBJID,
          LVS_SNAST         TYPE   SNAST,
          LVF_PROGRAM       LIKE   SY-REPID,
          LVS_COMM_TYPE     TYPE   AD_COMM,
          LVS_COMM_VALUES   TYPE   SZADR_COMM_VALUES,
          LVS_TITLE LIKE SNAST-TDCOVTITLE.
    reset return code
      RETCODE = 0.
    if there is a communication strategy used ...
    IF NOT NAST-TCODE IS INITIAL AND NAST-NACHA EQ '5'.
      ... use stratagy to get communication type
        CALL FUNCTION 'ADDR_GET_NEXT_COMM_TYPE'
             EXPORTING
                  STRATEGY           = NAST-TCODE
                ADDRESS_TYPE       =
                 ADDRESS_NUMBER     = KNA1-ADRNR
                PERSON_NUMBER      = VBDKA-ADRNP
                  PERSON_NUMBER      = ADDR_KEY-PERSNUMBER
             IMPORTING
                  COMM_TYPE          = LVS_COMM_TYPE
                  COMM_VALUES        = LVS_COMM_VALUES
           TABLES
                STRATEGY_TABLE     =
             EXCEPTIONS
                  ADDRESS_NOT_EXIST  = 1
                  PERSON_NOT_EXIST   = 2
                  NO_COMM_TYPE_FOUND = 3
                  INTERNAL_ERROR     = 4
                  PARAMETER_ERROR    = 5
                  OTHERS             = 6.
        IF SY-SUBRC <> 0.
          RETCODE = SY-SUBRC.
          SYST-MSGTY = 'E'.
          PERFORM PROTOCOL_UPDATE.
        ENDIF.
    ENDIF.
       LVS_COMM_TYPE = 'INT'.
      CLEAR LVS_COMM_VALUES-ADSMTP-SMTP_ADDR.
      CLEAR LVS_SNAST.
            LVS_COMM_VALUES-ADSMTP-SMTP_ADDR = V_CUST_EMAIL.
    convert communication data
       MOVE-CORRESPONDING NAST TO LVS_SNAST.
            LVS_SNAST-ANZAL = 1.
            LVS_TITLE = 'Mail Header Title'.
      MOVE LVS_TITLE TO LVS_SNAST-TDCOVTITLE.
       MOVE SY-REPID TO LVF_PROGRAM.
      CALL FUNCTION 'CONVERT_COMM_TYPE_DATA'
           EXPORTING
                PI_COMM_TYPE              = 'INT'
                PI_COMM_VALUES            = LVS_COMM_VALUES
                PI_SCREEN                 = XSCREEN
              PI_NEWID                  =
                PI_COUNTRY                = ADRC-COUNTRY
                PI_REPID                  = SY-REPID
                PI_SNAST                  = LVS_SNAST
                PI_MAIL_SENDER            = SY-UNAME
           IMPORTING
                PE_ITCPO                  = ITCPO_LS
                PE_DEVICE                 = LVF_DEVICE
                PE_MAIL_RECIPIENT         = LVS_RECIPIENT
                PE_MAIL_SENDER            = LVS_SENDER
           EXCEPTIONS
                COMM_TYPE_NOT_SUPPORTED   = 1
                RECIPIENT_CREATION_FAILED = 2
                SENDER_CREATION_FAILED    = 3
                OTHERS                    = 4.
      IF SY-SUBRC <> 0.
        RETCODE = SY-SUBRC.
        SYST-MSGTY = 'E'.
        PERFORM PROTOCOL_UPDATE.
      ENDIF.
      CHECK RETCODE EQ 0.
    fill structure itcpo
      ITCPO = ITCPO_LS.
    open form
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
              APPLICATION        = 'TX'
               ARCHIVE_INDEX      = TOA_DARA
               ARCHIVE_PARAMS     = ARC_PARAMS
                DEVICE             = 'MAIL'
                DIALOG             = 'X'
                FORM               = 'ZSDLS003'
                LANGUAGE           = SY-LANGU
                OPTIONS            = ITCPO_LS
                MAIL_SENDER        = LVS_SENDER
                MAIL_RECIPIENT     = LVS_RECIPIENT
              MAIL_APPL_OBJECT   = ' '
              RAW_DATA_INTERFACE = '*'
         IMPORTING
              LANGUAGE           =
              NEW_ARCHIVE_PARAMS =
              RESULT             =
           EXCEPTIONS
                CANCELED           = 1
                DEVICE             = 2
                FORM               = 3
                OPTIONS            = 4
                UNCLOSED           = 5
                MAIL_OPTIONS       = 6
                ARCHIVE_ERROR      = 7
                OTHERS             = 8.
      IF SY-SUBRC NE 0.
        CASE SY-SUBRC.
          WHEN 7.
            RETCODE = SY-SUBRC.
            SYST-MSGID = 'VN'.
            SYST-MSGNO = '096'.
            SYST-MSGTY = 'E'.
            SYST-MSGV1 = NAST-KSCHL.
            SYST-MSGV2 = NAST-KAPPL.
            PERFORM PROTOCOL_UPDATE.
          WHEN OTHERS.
            RETCODE = SY-SUBRC.
            PERFORM PROTOCOL_UPDATE.
        ENDCASE.
      ENDIF.
      SET COUNTRY ADRC-COUNTRY.
    ENDFORM.

  • How to capture output from Runtime.exec() ?

    Hi,
    Well, the question is in the subject ...
    I'd like to capture the output of a process ran by Runtime.exec() in order to process it.
    thanks,
    ionel

    Okay ...
    Sorry for the post !
    I found the solution : Runtime.exec().getOutputStream()
    Thanks however
    ionel

  • How near is "near" when using an external HD?

    I just bought a LaCie d2 Quadra hard disk on which to run Time Machine.  The LaCie literature says not to position the drive "near" a computer screen, speaker, etc. lest the data become corrupted and the drive fail.  Space is a premium on my desk, so I wonder whether placing the HD six inches from the iMac is too "near" for comfort?

    I have three External HD's (2 Maxtor One-Touch-Three's and CoolMax enclosure) sitting right next to my iMac and I've never had a problem.
    Dennis

  • No longer outputs video down FW, when using FW external HD?

    In a recent upgrade (I think it was actually when I went to OSX 10.4.6 - although it might have been QT 7.1.1 or even FCS 5.1.1) I have noticed that:
    - when using an external FW800 HD drive for captured footage, and trying to play out DV to my ADVC-100 (on a FW400 bus)
    - my dual G4 no longer plays DV out of FW for more than a few seconds. The FW video output just stops.
    The fact that it plays for a few seconds obviously shows it is all connected up and working OK.
    If I take the HD out of the external FW case and put it inside the G4 (on an IDE bus) - all is fine - DV plays out of FW indefinitely. It also used to work previously (before a software upgrade) - playing DV down FW400 while using external FW800 drives for captured footage.
    Familiar to anybody else? Any solutions?
    I am (I believe) all up to date with updates, including ProAppSupport.

    Answering my own question here:
    Solution was to use an additional FW PCI card (Sonnet Allegro) to give me a second FW bus in my Dual G4 1.42GHz FW800.
    I (wrongly) assumed that with a G4 FW800, with two FW400 ports and one FW800 port, that the FW800 and FW400 busses were separate. Not so, as someone pointed out, saying there are NO Macs with more than one FW bus built in.
    So, external HD on internal FW800 bus, and ADVC-100 on PCI FW400 card - and all is OK now.
    Can I give myself "solved" points?

  • I am using a WD external hard drive for backing up my laptop with Time Machine, but I have to do it manually. How do I know when it has finished the back up? How long should it take?

    I am using an external WD hard drive for backing up my laptop. I have to do it manually, so I can't set Time Machine to just do it for me. How do I know when it is done backing up? How long should this take?

    Triple-click anywhere in the line below to select it:
    tmutil compare -E
    Copy the selected text to the Clipboard (command-C).
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window (command-V).
    The command will take at least a few minutes to run. Eventually some lines of output will appear below what you entered.
    Each line that begins with a plus sign (“+”) represents a file that has been added to the source volume since the last snapshot was taken. These files have not been backed up yet.
    Each line that begins with an exclamation point (“!”) represents a file that has changed on the source volume. These files have been backed up, but not in their present state.
    Each line that begins with a minus sign (“-“) represents a file that has been removed from the source volume.
    At the end of the output, you’ll get some lines like the following:
    Added:
    Removed:
    Changed:
    These lines show the total amount of data added, removed, or changed on the source(s) since the last snapshot.

  • MiniDisplay to HDMI : How to turn off the Dual Monitor output when..

    miniDisplay to HDMI : How to turn off the Dual Monitor output when the adapter is attached and the TV is off ? And will keeping the adapter connected even if it is not in use, cause damage to the adapter ?

    I have my external monitor/tv setup of the left. If I leave the adapter attached with the TV off, I am still able to cross the border/boundry of my MBP screen ! As instead of detecting a TV, the MBP is detecting the adapter as a screen. I do not want to damage my thunderbolt/miniDisplay port by plugging and unpluggin the unit each and every time.

  • How to capture graphical outputs from other programs

    Does anyone know how we capture the graphical outputs from the other programs and show them
    on the swing?
    I'd like to use a java program to run gnuplot, capture the outputs, and show them using swing.

    Depends on what you mean by "graphic outputs".
    Taking a quick glance at the gnuplot homepage, it looks as if you can output to PNG files, so just run the app, and load the png file.

  • How do I output the smoothest video when changing or mixing frame rates from the original footage?

    I have been experimenting with various Media Encoder settings, and wondered if there was anything else I can try to get the smoothest video output possible, especially when changing frame rate and possibly resolution.  For clarification, let me start from the beginning and explain what I'm doing and what I've tried so far.  I'll try to be as brief as possible, but if I do go into too much detail, I apologize. 
    My original footage is AVCHD 1080p - 60fps.  (my camera only does 60fps...specifically 59.94fps)  We're not talking interlaced video here, I'm staying away from that.  This is definitely full frame, progressive video at 60 frames (not fields) per second.  My output will ultimately be for the web.  I have been keeping my output codec (H.264) and bit-rate (VBR 2-pass, relatively high-bitrate) consistent, and have been trying numerous output options and even sequence settings to see what would yield the best results.  I am using Premiere Pro CS5.5 along with Media Encoder.  Here's what I've done and the results I've observed:
    1.  I created a sequence with 1080p - 59.94fps settings to match my original footage.  I then output both 1080p and 720p versions at 59.94fps, and at 29.97fps.  The 59.94fps output files looked absolutely great, as would be expected.  Extremely smooth.  The 29.97fps output files were generally smooth, but not near as smooth as the 59.94fps.  This is expected since it's half the frame rate as my original footage.  However, my question is this:  What exactly is Media Encoder doing when "down converting" from 60p to 30p?  From a technical stand point, is it dropping every other frame?  I'm just curious to understand exactly what it does.  I tried the Frame Blending option as well, and that only yielded a bit more blur to the images which wasn't desirable for any of the output files. 
    2.  Just to see what would happen, I created a sequence with 1080p - 29.97 settings.  I then output both 1080p and 720p versions at 29.97fps.  The video was much more choppy in these cases, even with Frame Blending on.  Now, I know not matching my sequence settings with my original media isn't ideal, but I again just want to understand why this yields less smooth video than the 29.97fps options above.  Why does cutting the sequence settings frame rate in half from the original, then outputting the same frame rate as the sequence yield video that is not as smooth?
    3.  Next, I wanted to try mixing frame rates to see how Premiere and Media Encoder handled the footage and output files.  Premiere handled it great, no issues there.  However, I had some interesting things happen when I output the files.  Here's what I did:  I created a sequence with 1080p - 59.94fps to match my original footage.  Then I took the same exact footage that was in my sequence, copied it in my project panel and interpreted it at both 23.976 and 29.97 fps, yielding slow motion video.  The slow motion video looked great in Premiere, so I went ahead and just added it to my sequences, along with the original 59.94 footage.  I also created separate sequences for the 29.97 and 23.976 footage respectively, each with matching sequence settings, then added a nested sequence to another original footage sequence (with 59.94fps sequence settings) to see which yielded the best results.  Basically, I'm trying to output 59.94fps that match my original footage, but also throw in some slow motion footage at different framerates.  I'll explain my results in a moment as they are a bit convoluted, however, here is my question:  When mixing frame rates and trying to output the smoothest video, am I going about this the right way?  I would assume you would use your sequence settings that match the original footage (which is what the majority of the footage will be), then bring in a nested sequence for the slow motion (as oppose to just dropping the slow motion video directly into my main sequence), and then output to the same frame rate of the majority of the footage, in this case 59.94fps. Is there a better workflow for this?
    The results to #3 above were as follows.  Initially, it looked like it didn't matter if I nested the slow motion sequence into my main sequence, or simply dropped the actual slow motion video into my original 59.94fps sequence.  It seemed to produce smooth results either way.  Frame Blending blurred the video a bit, but didn't seem to make much difference, and quite honestly I like the footage without Frame Blending in general.  However, when I closed down Premiere, and opened the output files later (opening in Quicktime), the footage looked choppy.  In fact, it would go from choppy to smooth and back, almost like it had an irregular cadence (don't know if I'm using "cadence" in the right context here).  I would then open up Premiere again, import the output footage into my project panel, and play the footage in Premiere, and it would play back smooth again. Is this a Quicktime issue?  I was playing 1080p 59.94fps files when this happened, so maybe it's just because it's a large file.  Doesn't seem to have issues with the 720p files I created.  But it sure threw me off with my testing because I then started second guessing the settings I was using.  My iMac is the latest 2011 model with plenty of RAM, so I wouldn't think it's the computer.  Thoughts?
    4.  Next, I noticed on ALL my output files (again, using the H.264 codec from Media Encoder) that the color of my video seemed to flatten quite a bit.  It seems that the original footage has more contrast and saturation than the output files.  I figured maybe this was just how it was, but when I re-imported the output files back into Premiere, they looked IDENTICAL to the original footage.  And in Media Encoder's Source/Output windows, I don't see any difference there either. Is Quicktime again the culprit here, doing some odd things to the color of my videos?
    5.  Regarding Frame Blending, when is the best situation to enable this option in Media Encoder?  I've read it is when mixing frame rates, but I honestly didn't see too much of a change except for a bit more blur, which I didn't care for.
    6.  Lastly, my conclusion is that 60fps yields the smoothest video, which is an obvious conclusion.  However, I know that 60fps isn't the best or easiet frame rate for web delivery.  It seems 30p is more the standard.  Are there any integrated web players that would play 60fps?  Can you get 60fps video on YouTube/Vimeo?  If yes to any of these questions, can they do 720p and 1080p at 60fps? 
    Those are all my questions.  I hope I am clear enough without being overly wordy and hopefully I didn't put too many questions into one post.  Thanks in advance for any insight, I really appreciate it.

    Did you ever figure out which output worked the best? I have the same original footage; trying to determine the best output settings to make a dvd for tv.
    thanks!

  • How do i recover data from an external hard drive that was accidentally deleted?  After I verified the drive, a message appeared that said my drive needed to be repaired.  When I tried to access the drive again, the 700 Gigs of music is gone!

    How do i recover data from an external hard drive that was accidentally deleted?  After I verified the drive, a message appeared that said my drive needed to be repaired.  When I tried to access the drive again, the 700 Gigs of music is gone!

    Stop using the drive immediately, un plug it.
    Buy a copy of ProSoft DataRescue 4 and use it to search for deleted files.

  • How do I know when my backup is complete to my external hard drive

    How do I know when my back up is complete to an external har drive...new user

    Welcome to Apple Support Communities.
    If you are using Time Machine, open , System Preferences, System, Time Machine.
    It will show the status of the backup drive, including the date of the first backup, as well as the most recent.
    Checkmarking the 'Show Time Machine status in the menu bar' will allow you to view the latest Time Machine backup by clicking on the icon in the menu bar, without going through System Preferences each time.
    Clicking Open Time Machine Preferences... from the menubar takes you to the same Preference screen as shown above.
    The first backup will take a while, up to several hours or more, because it is a complete backup of everything on your system.

  • I have a 17" Macbook pro with flickering red and cyan(blue) lines across the screen. The issue disappears temporarily when I tap on the computer, and the problem does not occur when I use external display or try to screen capture the problem.

    I purchased my Macbook (17") through a certified apple tecnition in August 2012, it was refurbished and the motherboard was completely replaced. I do a lot of photo editing, but I have been unable to do so because of the red vibrating lines that interrupt my screen. The issue disappears temporarily when I tap on the computer, and the problem does not occur when I use external display or try to screen capture the problem. I brought the computer back to the technition I purchased it from and he said that it was a problem with my fan, so I have two new fans but the issue is still occuring. He says he doesnt know whats wrong. Does anyone have any information on this issue?
    Here is an image of the issue
    http://www.flickr.com/photos/67839707@N08/8884847081/

    I recommend having your Mac serviced by someone competent. A force sufficient to "blow apart" the fans was clearly excessive and may have damaged the display cable, as well as any number of other problems.
    Dust is properly cleaned with a vacuum, preferably one designed for computer service, and they are not cheap.
    Compressed air should never be used. It just blows dust everywhere, often into places where it can no longer be removed.

  • How to capture values dynamically from output screen

    Hi all,
    I have a new requirement.
    i developed a report which is showing output correctly. Here i have to take a check box for every record in output screen. if i check some of the check boxs then it should allow for further processing.
    i succeeded upto put checkboxes on output screen.
    but i don't know how to capture the values of checkboxes of every record into an internal table. it is necessary to capture into an internal table
    will it be work by using LOOP AT SCREEN statement.
    could you please explain with examples. it is normal report program only.
    i would appreciate an early reply
    Regards
    Prabhakar

    Sample code for usage:
    Internal table for Region and its Description
      data: begin of t_t005u occurs 0,
             LAND1 like t005u-land1,
             BLAND like t005u-bland,
             Bezei like t005u-bezei,
            end of t_t005u.
    Ranges for Country
      ranges: r_land1 for t005u-land1.
    Get the country codes and their descriptions
        refresh r_land1.
        clear r_land1.
      refresh t_dynpfields.
      move 'V_LAND1' to t_dynpfields-fieldname.
      append t_dynpfields.
      clear t_dynpfields.
    Read the value in the Country field on the screen
      call function 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = 'SAPLZ_VENDOR_MASTER'
          dynumb               = '0004'
          translate_to_upper   = 'X'
        TABLES
          dynpfields           = t_dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 01
          invalid_dynprofield  = 02
          invalid_dynproname   = 03
          invalid_dynpronummer = 04
          invalid_request      = 05
          no_fielddescription  = 06
          undefind_error       = 07.
      read table t_dynpfields with key fieldname = 'V_LAND1'.
      if not t_dynpfields-FIELDVALUE is initial.
        r_land1-low = t_dynpfields-FIELDVALUE.
        r_land1-sign = 'I'.
        r_land1-option = 'EQ'.
        append r_land1.
        clear r_land1.
      endif.
    Get the Regions to be displayed as F4 Help
      select land1
             bland
             bezei
        from t005u
        into table t_t005u
       where spras = 'EN'
         and land1 in r_land1.
      if not t_t005u[] is initial..
    Popup to display Valid Regions for the selected country
        CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
          EXPORTING
            ENDPOS_COL   = 60
            ENDPOS_ROW   = 40
            STARTPOS_COL = 40
            STARTPOS_ROW = 20
            TITLETEXT    = 'Region'
          IMPORTING
            CHOISE       = v_choice
          TABLES
            VALUETAB     = t_t005u
          EXCEPTIONS
            BREAK_OFF    = 1
            OTHERS       = 2.
        if sy-subrc = 0.
          if v_activity = 'V'.
            read table t_t005u index v_choice.
            if sy-subrc = 0.
              v_regio = t_t005u-bland.
              move 'V_BEZEI' to t_dynpfields-fieldname.
              move t_t005u-bezei to t_dynpfields-fieldvalue.
              append t_dynpfields.
    Update the Region description on the screen.
              call function 'DYNP_VALUES_UPDATE'
                EXPORTING
                  dyname               = 'SAPLZ_VENDOR_MASTER'
                  dynumb               = '0004'
                TABLES
                  dynpfields           = t_dynpfields
                EXCEPTIONS
                  invalid_abapworkarea = 01
                  invalid_dynprofield  = 02
                  invalid_dynproname   = 03
                  invalid_dynpronummer = 04
                  invalid_request      = 05
                  no_fielddescription  = 06
                  undefind_error       = 07.
            endif.
          endif.
        endif.
      endif.

Maybe you are looking for