‎2008 Nov 18 7:56 AM
How will I select different fields from different infotypes using provide statement?
‎2008 Nov 18 8:03 AM
PROVIDE FIELDS * from P0001 WHERE <cond>.
ENDPROVIDE.
Instead of the same you can get the fields in between the GET PERNR and END-OF-SELECTION loop as we do in HR ABAP.
use macro rp-provide-from-last space pn-begda pn-endda, to get the latest value of Info type. Use PNP Logical database.
Hope it helps.
Thanks,
Jayant
‎2008 Nov 18 8:03 AM
PROVIDE FIELDS * from P0001 WHERE <cond>.
ENDPROVIDE.
Instead of the same you can get the fields in between the GET PERNR and END-OF-SELECTION loop as we do in HR ABAP.
use macro rp-provide-from-last space pn-begda pn-endda, to get the latest value of Info type. Use PNP Logical database.
Hope it helps.
Thanks,
Jayant
‎2008 Nov 18 8:34 AM
hi,
why is it that the word "where" in the provide statement is marked as red which means error in my program.. I really need help because I am not familiar with the hr abap codes.tnx
‎2008 Nov 18 8:15 AM
HI...
WE can select the required fields using PROVIDE as
Syntax:
PROVIDE fieldnames FROM infty WHERE cond.
But PROVIDE is a obsolete statement, So we can Use GET pernr and append lines of those pernr from the required infotypes to the internal table.and then manipulate as required
Sample Code is to get all the fields from Infotype 0000, 0001 using LDB:
GET Pernr.
APPEND LINES OF p0000 TO wt_0000.
APPEND LINES OF p0001 TO wt_0001.
Hope its help you.
Regards,
K.Tharani.
‎2008 Nov 18 8:21 AM
I'm sorry because I'm not really familiar with hr abap.. can you please provide me an example.thanks..
‎2008 Nov 18 8:51 AM
Hi Fallow this
INFOTYPES:0000,0001,0002,0006.
TYPES:BEGIN OF T_FINAL,
PERNR TYPE PERNR_D,
STAT2 TYPE STAT2,
VORNA TYPE VORNA,
NACHN TYPE NACHN,
GDBAT TYPE GBDAT,
BUKRS TYPE BUKRS,
ORT01 TYPE ORT01,
ORGEH TYPE ORGEH,
PSTLZ TYPE PSTLZ,
END OF T_FINAL.
DATA:IT_FINAL TYPE STANDARD TABLE OF T_FINAL,
WA_FINAL TYPE T_FINAL.
START-OF-SELECTION.
GET:PERNR.
PERFORM F_FETCH_DATA_FROM_INFOTYPE.
END-OF-SELECTION.
PERFORM DISPLAY_DATA.
&----
*& Form F_FETCH_DATA_FROM_INFOTYPE
&----
FORM F_FETCH_DATA_FROM_INFOTYPE .
RP_PROVIDE_FROM_LAST P0000 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ 1.
WA_FINAL-PERNR = P0000-PERNR.
WA_FINAL-STAT2 = P0000-STAT2.
ENDIF.
RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND EQ 1.
WA_FINAL-BUKRS = P0001-BUKRS.
WA_FINAL-ORGEH = P0001-ORGEH.
ENDIF.
This is the procedure for coding,,,,,,,,,,,,,,,,,
Regards
Naresh