Max Titov IV @ TechSplice

The most beautiful music of all is the music of what happens.
  • Home
  • About

Posts Tagged ‘programmer’

21 Aug 2009

SAP: debugging in pop-up windows

Debugging in SAP is something that I do almost on a daily basis, most of the time I get by just by typing the /h command in the transaction window and executing the program but this is not always possible.

The scenario that I speak of occurs when you are debugging a pop-up window. When you are working with a pop-up window there is no convenient transaction window where you can turn on the debugger. So what do you do?

Simple.

Create a new file; lets call it debugger.txt and populate the contents of the file with the following lines:

[Function]

Title=Debugger Session

Command=/h

Type=SystemCommand

Save the file and leave it on your desktop.

Now when ever you get to a pop-up window that you want to debug simply drag the debugger.txt file in to the window and you will activate the debugging session.

Happy hunting!

21 August, 2009 at 18:38 by Max

Tags: code, debugging, programmer, sap
Posted in SAP/ABAP | No Comments »

4 Aug 2009

SAP – ABAP – gui – hiding selection components

If you want to make your reports more functional you can start controling the properties of different components based on selections that are performed by the user.

For instance in this post I’ll show you a quick example of how to hide a on-screen component based on user selection.

PARAMETER:  cb_a AS CHECKBOX DEFAULT 'X'
            USER-COMMAND batch MODIF ID ida,
            cb_bAS CHECKBOX DEFAULT 'X'
            USER-COMMAND batch MODIF ID idb.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-group1 = 'IDA' AND cb_b NE 'X'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDIF.

    IF screen-group1 = 'IDB' AND cb_a NE 'X'.
      screen-active = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

This example will hide each of the check boxes depending on the selection of the other check-box. If both are selected then both are visible, if one is un-checked then the other is hidden.

The active attribute controls the visibility of a particular screen component. Explicitly: 0 = hidden, 1 = visible.

4 August, 2009 at 13:52 by Max

Tags: abap, code, create, design, development, display, hide, programmer, sap, show, ui
Posted in SAP/ABAP | No Comments »

25 Mar 2009

ABAP: execute OS level command

There are many things that one can do to execute a command in an Operating System from an ABAP report.  I’ll explain one method that one can take to accomplish this.

  1. Using transactions SM49 and SM69 set up and test a new OS command that you wish to execute.  For the purposes of this post I’ve set up an executable command ZSAPCAR32.
  2. When I was setting up the new command I’ve selected the option to add additional parameters to the command.
  3. Once tested and satisfied you can add a new function module [SXPG_COMMAND_EXECUTE] to your report that will call preset executable command.
data: g_rlog                TYPE btcxpm OCCURS 0.

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
       EXPORTING
            commandname                   = 'ZSAPCAR32'
            additional_parameters         = <additional parameters>
            operatingsystem               = <system you specified in SM69>
       TABLES
            exec_protocol                 = g_rlog
       EXCEPTIONS
            no_permission                 = 1
            command_not_found             = 2
            parameters_too_long           = 3
            security_risk                 = 4
            wrong_check_call_interface    = 5
            program_start_error           = 6
            program_termination_error     = 7
            x_error                       = 8
            parameter_expected            = 9
            too_many_parameters           = 10
            illegal_command               = 11
            wrong_asynchronous_parameters = 12
            cant_enq_tbtco_entry          = 13
            jobcount_generation_error     = 14
            OTHERS                        = 15.

if sy-subrc eq 0.
    LOOP AT g_rlog INTO g_warlog.
*     display command output
      write g_warlog.
    ENDLOOP.
endif.

The above code will execute your OS command and display the results.

25 March, 2009 at 9:13 by Max

Tags: function, programmer, sap, SAP/ABAP
Posted in SAP/ABAP | 1 Comment »

25 Mar 2009

ABAP: load file using pop-up window

When writing a program the simplest way to load a file from your client PC in to the server SAP syste is through a use of a regular text box.  But if you want to get a little fancier try using the following function:

data: l_select TYPE sapb-sappfad.

CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
            def_filename     = l_select
            def_path         = ' '
            mask             = ',*.*,*.*.'
            mode             = 'O'
            title            = 'Select filename to OPEN'(f05)
       IMPORTING
            filename         = l_select
       EXCEPTIONS
            selection_cancel = 1
            selection_error  = 2
            OTHERS           = 3.

This function will open up a pop-up window [standard to windows] allowing the user to select a file somewhere on their local comptuer.

25 March, 2009 at 7:00 by Max

Tags: function, programmer, sap, SAP/ABAP
Posted in SAP/ABAP | No Comments »

2 Aug 2008

Programmer Competancy Matrix

I’d like to say that I am an all rounder levl 3 log(n) programmer but I am not 100%.  Having worked for over a year now in the business world I come to miss those little midnight session in the computer lab.

In either case I am determined to get better familiarized with the things that I’ve forgotten.

2 August, 2008 at 0:16 by Max

Tags: analysis, engineering, interesting, math, programmer, software
Posted in Software Engineering | No Comments »

  • Subscribe using FeedBurner
  • Cloud

    abap adobe animation basic beautiful builder camera code configuration contribution design development digital engineering fix flash Flex friends function images interesting lesson new paypal Photography php problem problems program programmer review sap SAP/ABAP sdk setup soap software solution story system tables transaction transports user video

    WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.

  • My Links

    • Cooking
    • Gallery
    • Resume
  • Online Tools

    • Airline Ticket Search
    • Estimate Shipping Cost [from US]
    • Link your Blog
  • Software Engineering Blogs

    • Adam Goucher
    • Joel on Software
    • The Third Bit
    • Wide Awake Developers
  • Categories

    • Everyday stuff
    • Flex
    • Photography
    • SAP/ABAP
    • Short Stories
    • Software Engineering
    • Web Development
  • Gallery

    Roy Tanck's Flickr Widget requires Flash Player 9 or better.

Max Titov IV @ TechSplice is proudly powered by WordPress
Design & code by Jonk
Entries (RSS) and Comments (RSS).
Podcast Powered by podPress (v8.8)