2007 Jan 09 7:47 AM
hi all,
here i using logical database in objects the problem is my pernr struction is populating but the structures that needs to be populated like p0001 r not getting when i am using objects.but normal way result is fine.but through objects i am getting data.is there any specific class for lbd.please reply soon .
Thanks,
Phani.Sista
2007 Jan 09 9:38 AM
Hi,
Infotypes P0001."[mention the infotypes that are used in this ldb].
start-of-selection.
get pernr.
provide from p0001 between pn-begda and pn-endda.
write 😕 p0001-pernr.
endprovide.
Check in debuggin where the data is not populating.Check whether pa0001 contains records.
hi all,
here i using logical database in objects the problem is my pernr struction is populating but the structures that needs to be populated like p0001 r not getting when i am using objects.but normal way result is fine.but through objects i am getting data.is there any specific class for lbd.please reply soon .
Thanks,
Phani.Sista
2007 Jan 09 7:51 AM
Hi,
I hope you will be selecting the ldb in attributes.
Have you declared infotypes?
Infotype p0001.
2007 Jan 09 9:32 AM
hi,
yes i declared infotypes and in attributes also i delared LDB.BUT EVEN THEN I COULD NOT ABLE TO GET MY DATA.
REGARDS,
PHANI.SISTA
2007 Jan 09 9:38 AM
try to use this code ,change it as per ur needs and see if it works or not..may b eu have something wrong with PND selection criteria..put a brakpoint at Get pernr event and see if the program stops there or not..if it is not stopping then it means there is no pernr to process and u have to check ur selection criteria.
reward if helpfull
REPORT ZPPL_PREVEMPLOYERS message-id rp
line-size 250
line-count 65.
tables: pernr.
infotypes: 0021.
*eject
&----
*& Constants *
*& *
&----
constants: c_1(1) type c value '1' .
data: begin of t_output occurs 0,
num_dep(2) type n,
pernr like pernr-pernr.
data: end of t_output.
data: count type i.
*eject
&----
*& Initialization *
*& *
&----
Initialization.
Initialize Selection-Screen values
perform init_selction_screen.
Start-of-selection.
get pernr.
clear t_output.
Read Infotype 0021
rp-provide-from-last p0021 space pn-begda pn-endda.
check pnp-sw-found eq c_1.
Gather all the required information related to the emp
describe table p0021 lines count.
move: pernr-pernr to t_output-pernr,
count to t_output-num_dep.
append t_output.
Clear count.
*eject
&----
*& End-of Selection *
*& *
&----
end-of-selection.
perform print_report.
*eject
&----
*& Form print_report
&----
*Description:
----
FORM print_report .
Print the report
loop at t_output.
skip 1.
at sum
write: 2 t_output-pernr,
15 t_output-num_dep.
endloop.
ENDFORM. " print_report
2007 Jan 09 9:38 AM
Hi,
Infotypes P0001."[mention the infotypes that are used in this ldb].
start-of-selection.
get pernr.
provide from p0001 between pn-begda and pn-endda.
write 😕 p0001-pernr.
endprovide.
Check in debuggin where the data is not populating.Check whether pa0001 contains records.
2007 Jan 09 9:49 AM
hi,
here i am using a grid display using PNP.here i am using object oriented concepts just have a look at my program.ok.
REPORT zsp01.
INFOTYPES:0000,0001,0002.
TABLES: pernr.
*TYPES: BEGIN OF x_p0001,
pernr LIKE p0001-pernr,
END OF x_p0001.
*DATA: it_p0001 TYPE TABLE OF X_P0001,
DATA : IT_P0001 TYPE TABLE OF P0001,
X_P0001 LIKE LINE OF IT_P0001,
it_fieldcatalog TYPE lvc_t_fcat WITH HEADER LINE ,
custom_container TYPE REF TO cl_gui_custom_container,
grid1 TYPE REF TO cl_gui_alv_grid.
START-OF-SELECTION.
GET pernr .
CALL SCREEN 200.
----
MODULE STATUS_0200 OUTPUT
----
*
----
MODULE status_0200 OUTPUT.
SET PF-STATUS 'ABC'.
IF custom_container IS INITIAL.
create a custom container control for our ALV Control
CREATE OBJECT custom_container
EXPORTING
container_name = 'CONTAINER'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
.
CREATE OBJECT grid1
EXPORTING
i_parent = custom_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
OTHERS = 5
.
ENDIF.
ENDMODULE. " STATUS_0200 OUTPUT
MODULE display OUTPUT.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'P0001'
CHANGING
it_outtab = IT_P0001
it_fieldcatalog = it_fieldcatalog[]
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
ENDMODULE. " DISPLAY INPUT
*MODULE fieldcat OUTPUT.
CLEAR it_fieldcatalog.
it_fieldcatalog-fieldname = 'PERNR'.
it_fieldcatalog-ref_table = 'P0001'.
it_fieldcatalog-ref_field = 'PERNR'.
APPEND it_fieldcatalog.
*
*ENDMODULE. " FIELDCAT OUTPUT
module USER_COMMAND_0200 input.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0200 INPUT
just check this program and let me know the changes.
Regards,
Phani.sista
2007 Jan 09 9:54 AM
1)instead of IT_p0001 in the output display function,just pass P0001 only..
it wil work.
2) and where u r filling IT IT_p0001 with data ,if u want to pass it?
2007 Jan 09 9:57 AM
hi,
that is my problem to fill it_P0001,my pernr is populating and how to do that.can u suggest me anything.
Regards,
Phani.sista
2007 Jan 09 9:57 AM
Hi,
START-OF-SELECTION.
GET pernr .
rp_provide_from_last p0000 space pn-begda pn-endda.
...
here p0000 will contain values
You need to use macro or provide to fetch data and assign it to itab.
end-of-selection.
call screen 200
Jayanthi Jayaraman