‎2007 Jul 09 3:30 PM
hello All,
I have a reqmnt, My client has an existing ad hoc query and I need to add two fields to it, both of the fields are not direct and needs some coding, cud anyone please explain how can i go bout it?
thanks,
RS
‎2007 Jul 09 3:42 PM
Ok....This is not the way to go....But it's the way they work on my current project....You can go to SE38 with the name of the generated program and add the needed fields....
Don't blame me....Blame my employeers -;)
Greetings,
Blag.
‎2007 Jul 09 3:42 PM
Ok....This is not the way to go....But it's the way they work on my current project....You can go to SE38 with the name of the generated program and add the needed fields....
Don't blame me....Blame my employeers -;)
Greetings,
Blag.
‎2007 Jul 09 3:58 PM
Its quite straight forward, so just have a play around, but the steps are something like:
1. SQ01/environment/info sets/query areas/standard
2. Choose the info set you wish to change
3. Choose the filed group you wish to add a field to
4. Right click the infoset you want to add a field to
5. Add the new field to the field group for that infoset
6. Then use the extras button to add code to that field
I tend to use the initialization, and record processing event blocks for adding my code. USe the eblow link for the SAP documentation.
And here is some sample code i've used for one particaulr field, just to give you an idea of how easy it is.
rp_provide_from_last p0000 space pn-begda pn-endda.
* Get last Ity2001 record
IF p0000-massn = '16'.
SELECT SINGLE pernr max( endda )
FROM pa2001
INTO (p2001-pernr, p2001-endda)
WHERE pernr = pernr-pernr
GROUP BY pernr.
ELSE.
rp_provide_from_last p2001 space pn-begda pn-endda.
ENDIF.
SELECT SINGLE UMSKD
INTO WA_UMSKD
FROM Y0PT_AMMSUBS
WHERE PERNR = p2001-pernr
AND ENDDA = p2001-endda.
wa_OCCHC = wa_UMSKD(2).
occhealth = wa_OCCHC.<a href="http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm">http://saphelp.user.ad.glasgow.gov.uk:8000/saphelp/helpdata/EN/d2/cb3efb455611d189710000e8322d00/frameset.htm</a>