1. Before doing a for all select, just make sure the internal table you are using for all select is not empty (INITIAL). If it is empty then for all select will fetch all the records in the database and thay may be a problem. So be careful.
SAP recommends that you should only use field symbol when you can not achieve the same functionality by other means.
DATA: i_stxh TYPE STANDARD TAB
w_stxh TYPE stxh.
SELECT * FROM stxh
INTO TABLE i_stxh
WHERE tdobject = p_1.
FIELD-SYMBOLS <i_t> TYPE ANY t
FIELD-SYMBOLS <w_t> TYPE ANY.
data: name(10) TYPE c.
data: name1(10) TYPE c.
name = 'I_STXH'.
name1 = 'W_STXH'.
ASSIGN (name) TO <i_t>.
ASSIGN (name1) TO <w_t>.
IF sy-subrc = 0.
ENDIF.
LOOP AT <i_t> INTO <w_t>.
ENDLOOP.
Using i IDoc / Output Type special processing options
by Biswa | Monday, April 27, 2009 in | comments (1)
This content has been moved to the below link. Please visit it at your convenience. Thank you for your patience and cooperation.
IDoc Tips - Change Pointers and Reprocessing IDocs
by Biswa | Sunday, April 26, 2009 in Change Pointers, IDocs | comments (3)
IDocs using Change Pointers - Useful Transactions
1. BD21 - Creating IDoc Types from Change Pointers
Sometimes lot of Change Pointer gets created, but fails to get processed due to system issues.
This t-code is quite helpful to generate IDocs from unprocessed change pointers. The status of change pointer can easily be checked from BDCPV table/view.
2. BD22 -Delete Change Pointers
This one is also quite helpful in production environment. Sometimes we can have scenarios where a lot of change pointers gets created due to some erroneous configuration or settings. In order to remove them from the system and clear up the associated tables, this t-code is quite helpful.
3. Reprocessing Successful IDocs again
Using BD87, we cannot re-process successful IDocs again, but sometime certain issues may require us to re-send an already processed successful IDoc.
Also, If the number of Idocs that needed to be retransmitted is limited, then you can retransmit them from the concerned application like Shipment, Delivery, Purchase Order by Reprocessing the Output Type.
But when we need to transmit multiple IDocs, using the standard program RC1_IDOC_SET_STATUS is quite helpful.
You can go to WE02 or WE09, copy all the processed IDoc numbers and paste them after executing this program in SE38. You would also need to specify the new IDoc status .
If you need to process this IDoc again using BD87, you cann;t directly set the same to 30 ( IDoc ready for dispatch), as BD87 remembers the last status (which was '53'- Application document posted) and hence wouldn't again process this IDoc.
Hence we can change the status to say some intermediate one like 32 - (Idoc was edited) and then again run this program and change the status t0 30 from 32.
After that we can again process this IDocs using BD87 and re-send them to the external system like EDI.
Search help from the values in Internal table
by Voice | Friday, February 27, 2009 in Search Help, Selection screen | comments (0)
Sometime the requirement is such that search help is required from the values obtained in run time or from constant values. In this you can use the FM: F4IF_INT_TABLE_VALUE_REQUEST to meet your purpose. The basic logic is that it uses data from the internal table to show in the F4 search help.
Example: Here an internal table is populated with some constants. This program is just for guideline.
* Type for internal table for populating the file-type
Types: BEGIN OF x_filtyp,
filetype TYPE char3, " File type
description TYPE char50, " description
END OF x_filtyp.
***********************************************************************
* INTERNAL TABLES *
***********************************************************************
DATA:
* File type
i_filtyp TYPE STANDARD TABLE OF x_filtyp INITIAL SIZE 0,
PARAMETERS: p_file(3) TYPE c.
***********************************************************************
* INITIALIZATION *
***********************************************************************
INITIALIZATION.
*Populating file type in an internal table
PERFORM sub_filtyp.
***********************************************************************
* AT SELECTION-SCREEN *
***********************************************************************
AT SELECTION-SCREEN.
* On value request for p_filtyp
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_filtyp .
PERFORM sub_get_help_filtyp USING p_file.
*&---------------------------------------------------------------------*
*& Form sub_filtyp
*&---------------------------------------------------------------------*
FORM sub_filtyp.
* local variables
DATA: l_wa_filtyp TYPE x_filtyp. "work area
* Appending row
l_wa_filtyp-filetype = c_a.
l_wa_filtyp-description = 'Alphabet A'.
APPEND l_wa_filtyp TO i_filtyp.
* Appending row
l_wa_filtyp-filetype = c_b.
l_wa_filtyp-description = 'Alphabet B'.
APPEND l_wa_filtyp TO i_filtyp.
ENDFORM. "sub_filtyp
*&---------------------------------------------------------------------*
*& Form sub_get_help_filtyp
*&---------------------------------------------------------------------*
FORM sub_get_help_filtyp USING l_filtyp .
* local vairables
DATA: l_dynfld TYPE dynfnam, "Screen Field Name
l_retfld TYPE fieldname, "Return Field Name
l_i_fields TYPE STANDARD TABLE OF dfies, "for call function
l_i_return TYPE TABLE OF ddshretval, "for call function
l_wa_field TYPE dfies, "work area
l_wa_return TYPE ddshretval, "work
l_wa_value TYPE seahlpres,
l_i_value TYPE STANDARD TABLE OF seahlpres,
l_i_mapping TYPE STANDARD TABLE OF dselc,
l_wa_mapping TYPE dselc.
l_wa_mapping-fldname = 'DESCRIPTION'.
APPEND l_wa_mapping TO l_i_mapping.
l_wa_field-fieldname = 'FILETYPE'.
l_wa_field-tabname = 'I_FILTYP'.
l_wa_field-intlen = 6.
l_wa_field-leng = 6.
l_wa_field-outputlen = 6.
l_wa_field-position = 1 .
l_wa_field-scrtext_s = l_wa_field-fieldname.
l_wa_field-scrtext_m = l_wa_field-fieldname.
l_wa_field-scrtext_l = l_wa_field-fieldname.
l_wa_field-reptext = l_wa_field-fieldname.
APPEND l_wa_field TO l_i_fields.
CLEAR l_wa_field .
l_wa_field-fieldname = 'DESCRIPTION'.
l_wa_field-tabname = 'I_FILTYP'.
* l_wa_field-OFFSET = 3.
l_wa_field-intlen = 50.
l_wa_field-leng = 50.
l_wa_field-outputlen = 50.
l_wa_field-position = 2 .
l_wa_field-scrtext_s = l_wa_field-fieldname.
l_wa_field-scrtext_m = l_wa_field-fieldname.
l_wa_field-scrtext_l = l_wa_field-fieldname.
l_wa_field-reptext = l_wa_field-fieldname.
APPEND l_wa_field TO l_i_fields.
LOOP AT i_filtyp INTO wa_filtyp.
l_wa_value-string = wa_filtyp-filetype.
APPEND l_wa_value TO l_i_value.
l_wa_value-string = wa_filtyp-description.
APPEND l_wa_value TO l_i_value.
ENDLOOP.
l_retfld = 'FILETYPE'.
l_dynfld = l_filtyp.
* call fucntion for search help
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = l_retfld
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = l_dynfld
window_title = 'Filetype'
* value_org = 'S'
callback_program = sy-repid
TABLES
value_tab = l_i_value
field_tab = l_i_fields
return_tab = l_i_return
* dynpfld_mapping = l_i_mapping
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3.
IF sy-subrc NE 0.
ELSE.
READ TABLE l_i_return INTO l_wa_return
WITH KEY fieldname = 'FILETYPE'.
IF sy-subrc EQ 0.
l_filtyp = l_wa_return-fieldval.
ENDIF.
ENDIF.
ENDFORM. " sub_get_help_filtyp
You can add your code in AT SELECTION-SCREEN for establishing dependency on two or more selection screen parameters.
Example:
PARAMETERS: p_matnr TYPE matnr,
p_check TYPE char1.
AT SELECTION-SCREEN.
IF p_matnr = '000000000000000023' .
p_check = '1'.
ELSEIF p_matnr = '1697'.
p_check = 2.
ENDIF.
Output
For P_matnr = 23 (selected by user), p_check will be automatically populated 1 and 2 for p_matnr = 1697.
Interesting details of Application Server
by Raju | Wednesday, February 25, 2009 in Application Server, Dispatcher, Interpreter, Roll Area, Task Handler, User Context, Work Process | comments (3)
The content has been moved to below link. Please visit it at your convenience. Thank you for all your cooperation.
I was writing a program for ALV Grid after a long time. I was using CL_GUI_ALV_GRID class for the required ALV display and I encountered some problems. I tried to consult with my friends and finally we did it but it took a lot of experimentation and time and also I came to know a lot of things about CL_GUI_ALV_GRID and thought it is worth sharing.
First and foremost, never make unnecessary custom screens and containers it is not totally unavoidable. Custom screens with containers look pretty but it causes a unique problem which is hard to conceive. Have a look..
This is normal display. I used a custom screen with container to show the ALV Grid. Click on Customize Local Layout (Alt+F12) and then Font and increase the font size.
Depending on your monitor size and resolution at some point you will see that scroll bars are gone. Something like this will happen
Actually the custom window has got magnified and the scroll bars are out of monitor size. This problem will not happen if you use the default screen for report display.
If you want print out you have to add another Event, PRINT_TOP_OF_PAGE. What ever you will write here will get printed.
Then also you will face problems for printing the page number. Please write to me in the comment section if you want to know how, I don’t want to make this post any longer
Please let me know if any of you want the code or some other information. Reason is same… I don’t want to increase the size of the post.