Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

provide statement

Former Member
0 Likes
714

How will I select different fields from different infotypes using provide statement?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
682

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

5 REPLIES 5
Read only

Former Member
0 Likes
683

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

Read only

0 Likes
682

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

Read only

Former Member
0 Likes
682

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.

Read only

Former Member
0 Likes
682

I'm sorry because I'm not really familiar with hr abap.. can you please provide me an example.thanks..

Read only

Former Member
0 Likes
682

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