SAP tp: return codes
For each step that takes place within the tp command there could be 8 different possible return codes [0, 4, 6, 8, 12, 13, 14, 16]. The meaning for each of those codes is as follows:
Transport imported successfully:
0: Transport successful
4: Warning occurred
Transport did not import successfully:
6: Post-processing is required
8: Transport carried out with an error [individual object could not be transported successfully]
ex: objects could not be overwritten
Transport termination:
12 and greater: transport was terminated
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!
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.
ABAP cancelling an SD Billing Document
If you have access to a billing document number try executing the following function:
DATA: l_rtrn TYPE bapireturn1 OCCURS 0.
DATA: l_succ TYPE bapivbrksuccess OCCURS 0.
CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
EXPORTING
billingdocument =
* testrun =
* no_commit =
billingdate = sy-datum
TABLES
return = l_rtrn
success = l_succ.
This should create a cancellation document.
SAPGUI_PROGRESS_INDICATOR
A usefull little function that will allow you to display a status update on the bottom left corner of the screen when running your reports.
call function 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = 0
text = STATUS_TEXT.
Note: anything lower then 0 will be rounded up to 0 and anything greater then 100 will be rounded down to 100.
Cyrilic integration of Flex and PHP
A recent project involved integration between a PHP content management tool like Joomla and Adobe Flex 2. I wrote a PHP script that parsed a MySQL database creating an XML structure that was then picked up by a HTTPService in a Flex application.
The information in the database was stored in Cyrillic format, hence when ever I was loading the data in to the SWF compiled file the end result was a collection of garbage data. Setting the actuall HTML to Windows-1251 encoding did not help the situation.
My following approach was to locate a native functionality within the Flex architecture to mediate the situation. Unforchunately I wasn’t successful in aquiring sattisfying examples to solve the problem. For that matter it became sadly obvious that I haven’t seen any flash pages using non/english alphabet [either I haven't been checking international sites that much or Adobe Flex isn't widely used overseas] .
My third approach was to look at the actual php code that was generating the XML structure. I’ve discovered a useful function mb_convert_encoding that eventually solved my problems. Using a simple snippet of code:
mb_convert_encoding($string_to_convert,'UTF-8','Windows-1251');
I was able to convert the data from UTF-8 in to Windows-1251 which allowed me to display the desired Cyrillic characters.