We can help. Together we learn....

Field symbol - Info

by Voice | Monday, April 27, 2009 in | comments (0)

SAP recommends that you should only use field symbol when you can not achieve the same functionality by other means. 

Performance wise it is better to use field symbols but if not used properly, it can give a short dump. With conventional work area method, syntax checker is able to detect most of such errors incorporated in the code. But with field symbol it is unable to do so and hence unless and until you are very sure about the use, field symbols may back fire on you.

Below is one sample code which can help you in understanding the use of field symbols. Like a work are or table, field symbols can be declared by using a structure or it can be left unassigned and in this case it take the structure of the variable with which it is referred for the first time.

Field-symbols become indespensible when in your program there is a need to create a work area name or field name or internal table name dynamically. 

In this example, field symbols are used to call an internal table dynamically. You can extrapolate the same concept to work area and variables.

----------------------------------------------------------------------------------------------
PARAMETERS: p_1 TYPE tdobject.

DATA: i_stxh TYPE STANDARD TABLE OF stxh,
      w_stxh TYPE stxh.

SELECT * FROM stxh
INTO TABLE i_stxh
WHERE tdobject = p_1.

FIELD-SYMBOLS <i_t> TYPE ANY table.
FIELD-SYMBOLS <w_t> TYPE ANY.
data: name(10TYPE c.
data: name1(10TYPE 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.
 



--------------------------------------------------------------------------------------------------------------------------------------------------------
If you wish to assign content on one field symbol to other field symbol you can use,
assign <fs1> to <fs2>.

We are moving to a better and faster site SAPYard.com  (http://www.sapyard.com/).

This content has been moved to the below link. Please visit it at your convenience. Thank you for your patience and cooperation.

http://www.sapyard.com/using-idoc-output-type-special-processing-options/

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.

Categories