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

selection query

Former Member
0 Likes
974

hello..

i have a report in which the selection is done like this,and the internal tables nor the columns have been declared in the normal manner.how should i get to know about the tables,fields that are used for populating.

Also,if debug can help what all the parameters to check.

kindly help.

START-OF-SELECTION.

SET PARAMETER ID 'CDO' FIELD objekt.

SET PARAMETER ID 'CDI' FIELD objektid.

SET PARAMETER ID 'CDU' FIELD aenderer.

SET PARAMETER ID 'CDD' FIELD datum.

SET PARAMETER ID 'CDZ' FIELD zeit.

SET PARAMETER ID 'CDA' FIELD dat_bis.

SET PARAMETER ID 'CDB' FIELD zeit_bis.

SET PARAMETER ID 'CDN' FIELD nummer.

SET PARAMETER ID 'CDT' FIELD tabname.

SET PARAMETER ID 'CDK' FIELD tabkey.

SET PF-STATUS 'SELT'.

SET TITLEBAR '100' WITH objekt.

  • get the accessibility_mode --> shows only in ALV-Grid

CALL FUNCTION 'GET_ACCESSIBILITY_MODE'

IMPORTING

accessibility = lv_accessibility

EXCEPTIONS

its_not_available = 1

OTHERS = 2.

  • lv_accessibility = "X" --> accessibility on

IF sy-subrc IS INITIAL.

IF new_disp IS INITIAL AND NOT lv_accessibility IS INITIAL.

new_disp = lv_accessibility.

ENDIF.

ENDIF.

CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' "B20K8A0GP1

EXPORTING

text = 'Daten werden selektiert...'(010).

IF new_disp = 'X'.

  • new ALV display

CALL FUNCTION 'CHANGEDOCUMENT_READ'

EXPORTING

changenumber = nummer

date_of_change = datum

objectclass = objekt

objectid = objektid

tablekey = tabkey

tablename = tabname

time_of_change = zeit

username = aenderer

tablekey254 = tabkeylo

keyguid = keyguid

date_until = dat_bis

time_until = zeit_bis

TABLES

editpos = editpos_with_header

EXCEPTIONS

no_position_found = 1

OTHERS = 2.

CASE sy-subrc.

WHEN 0.

applicationid = objekt.

CALL FUNCTION 'CHANGEDOCUMENT_DISPLAY'

EXPORTING

i_applicationid = applicationid

flg_autocondense = 'X'

i_objectclas = objekt

TABLES

i_cdred = editpos_with_header.

WHEN 1.

WRITE: 'Keine Positionen gefunden'(101).

WHEN 2.

WRITE: 'Fehler beim Lesen'(102).

ENDCASE.

ELSE. "old display

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

EXPORTING

objectclass = objekt

objectid = objektid

username = aenderer

time_of_change = zeit

date_of_change = datum

date_until = dat_bis

time_until = zeit_bis

TABLES

i_cdhdr = icdhdr

EXCEPTIONS

no_position_found = 1

OTHERS = 2.

CASE sy-subrc.

WHEN 0.

IF nummer NE space.

DELETE icdhdr WHERE changenr NE nummer.

ENDIF.

PERFORM check_cdpos.

DESCRIBE TABLE icdhdr LINES count1.

IF NOT count1 IS INITIAL.

CLEAR count1.

PERFORM ausgabe_header.

ELSE.

WRITE: 'Keine Positionen gefunden'(101).

ENDIF.

WHEN 1.

WRITE: 'Keine Positionen gefunden'(101).

WHEN 2.

WRITE: 'Fehler beim Lesen'(102).

ENDCASE.

ENDIF. "new_display_Active

AT USER-COMMAND.

IF sy-ucomm = 'PRI' AND sy-lsind = '2'.

PERFORM ausgabe_positionen.

NEW-PAGE PRINT OFF.

ENDIF.

IF sy-ucomm = 'F2' AND sy-lsind = '1'.

nummer = ls_cdhdr-changenr.

IF ls_cdhdr-changenr = space.

MESSAGE s886.

sy-lsind = 0.

ELSE.

REFRESH: ausg. "B20K8A0MNS

CLEAR: ls_cdhdr-changenr, ls_cdhdr-objectid.

CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'

EXPORTING

changenumber = nummer

tablename = tabname

tablekey = tabkey

IMPORTING

header = ls_cdhdr

TABLES

editpos = ausg

EXCEPTIONS

no_position_found = 1

OTHERS = 2.

CASE sy-subrc.

WHEN 0. PERFORM ausgabe_positionen.

WHEN 1. WRITE: 'Keine Positionen gefunden'(101).

WHEN 2. WRITE: 'Fehler beim Lesen'(102).

ENDCASE.

ENDIF.

ENDIF.

TOP-OF-PAGE.

PERFORM ueberschrift_header.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE list.

WHEN 0.

PERFORM ueberschrift_header.

WHEN 1.

PERFORM ueberschrift_positionen.

ENDCASE.

8 REPLIES 8
Read only

Former Member
0 Likes
898

Hi Tanisha

Can you please post the deceleration of internal tables here so that we can have a clue

or else try using where used list for that report and select tables

Regards

Vikas C

Read only

0 Likes
898

Hi Tanisha

Or else

U can try this

Go to report and then click "display object list" CTRLSHIFTF5 and then see in the scroll down menu "Dictionary structures" so that you can see all the tables used in that particular report

Read only

0 Likes
898

I think

cdhdr,cdpos are the only tables used do you have fields in there corresponding to selectionscreen fields.

Read only

0 Likes
898

I think

cdhdr,cdpos are the only tables used do you have fields in there corresponding to selectionscreen fields.

Read only

Former Member
0 Likes
898

Please see to the below declaration that is there before start of seelction.

rest nothing is given thats why its becoming difficult to find the tables and the fields.

tables:cdhdr,cdpos.

SELECTION-SCREEN BEGIN OF BLOCK b1.

PARAMETERS: objekt TYPE tcdob-object,

objektid TYPE cdhdr-objectid,

aenderer TYPE cdhdr-username,

datum TYPE cdhdr-udate,

zeit TYPE cdhdr-utime,

dat_bis TYPE cdhdr-udate DEFAULT sy-datum,

zeit_bis TYPE cdhdr-utime DEFAULT '235959',

nummer TYPE cdhdr-changenr DEFAULT ' ',

tabname TYPE cdpos-tabname DEFAULT ' ',

tabkey TYPE cdpos-tabkey DEFAULT ' ',

tabkeylo TYPE cdpos_uid-tabkey DEFAULT ' ',

keyguid TYPE cdpos_uid-keyguid DEFAULT ' ',

key_exp TYPE c DEFAULT ' ',

new_disp AS CHECKBOX DEFAULT 'X'.

select-options: s_udate for cdhdr-udate.

parameters:tcode type cdhdr-tcode,

fname type cdpos-fname,

VAL_OLD type cdpos-value_old.

SELECTION-SCREEN END OF BLOCK b1 .

TYPES : BEGIN OF ty_keys. "alle Keyfelder aller Tab.

INCLUDE TYPE x031l. "B20K8A0OGR

TYPES: placement TYPE i

,length TYPE i

,new_offset TYPE i

,scrlen1 TYPE i "B20K8A0OGR

,scrlen2 TYPE i "B20K8A0OGR

,scrlen3 TYPE i "B20K8A0OGR

,text(1) TYPE c

,scrtext_s TYPE dfies-scrtext_s

,scrtext_m TYPE dfies-scrtext_m

,scrtext_l TYPE dfies-scrtext_l

.

TYPES: END OF ty_keys

,ty_t_keys TYPE STANDARD TABLE OF ty_keys.

      • Variables

DATA :

buffer(67) TYPE c

,ausg TYPE TABLE OF cdshw "Ausgabeaufbereitung

,icdhdr TYPE TABLE OF cdhdr "Änderungsbelegkopfzeilen

,all_keys TYPE ty_t_keys "alle Keyfelder aller Tab.

,idfies TYPE TABLE OF dfies "Schnittstelle DDIF_NAMETAB_GET

,ix301l TYPE TABLE OF x031l "Schnittstelle DDIF_NAMETAB_GET

,list TYPE i

,count1 TYPE i

,count2 TYPE i

,ls_cdhdr TYPE cdhdr

,ls_keys TYPE ty_keys

  • prepared output with header info

,editpos_with_header TYPE TABLE OF cdred

,applicationid TYPE repid

  • for ACCESSIBILITY check

,lv_accessibility(1) TYPE c

.

FIELD-SYMBOLS: TYPE x031l "B20K8A0OGR

.

INITIALIZATION.

AUTHORITY-CHECK OBJECT 'S_SCD0'

ID 'ACTVT' FIELD '08'.

IF sy-subrc NE 0.

MESSAGE s800.

LEAVE.

ENDIF.

GET PARAMETER ID 'CDO' FIELD objekt.

IF objekt = space.

objekt = 'BANF'.

SET PARAMETER ID 'CDO' FIELD objekt.

datum = '00000000'.

SET PARAMETER ID 'CDD' FIELD datum.

zeit = '000000'.

SET PARAMETER ID 'CDZ' FIELD zeit.

ELSE.

GET PARAMETER ID 'CDI' FIELD objektid.

GET PARAMETER ID 'CDU' FIELD aenderer.

GET PARAMETER ID 'CDD' FIELD datum.

GET PARAMETER ID 'CDZ' FIELD zeit.

GET PARAMETER ID 'CDA' FIELD dat_bis.

GET PARAMETER ID 'CDB' FIELD zeit_bis.

GET PARAMETER ID 'CDN' FIELD nummer.

GET PARAMETER ID 'CDT' FIELD tabname.

GET PARAMETER ID 'CDK' FIELD tabkey.

ENDIF.

Read only

Former Member
0 Likes
898

Hey Tanisha

Its pretty clear i guess

PARAMETERS: objekt TYPE tcdob-object, here tcdob is table and object is fieldname

objektid TYPE cdhdr-objectid, here cdhdr is table and objectid is fieldname and so on

aenderer TYPE cdhdr-username,

datum TYPE cdhdr-udate,

zeit TYPE cdhdr-utime,

dat_bis TYPE cdhdr-udate DEFAULT sy-datum,

zeit_bis TYPE cdhdr-utime DEFAULT '235959',

nummer TYPE cdhdr-changenr DEFAULT ' ',

tabname TYPE cdpos-tabname DEFAULT ' ',

tabkey TYPE cdpos-tabkey DEFAULT ' ',

tabkeylo TYPE cdpos_uid-tabkey DEFAULT ' ',

keyguid TYPE cdpos_uid-keyguid DEFAULT ' ',

key_exp TYPE c DEFAULT ' ',

new_disp AS CHECKBOX DEFAULT 'X'.

select-options: s_udate for cdhdr-udate.

parameters:tcode type cdhdr-tcode,

fname type cdpos-fname,

VAL_OLD type cdpos-value_old.

Hope it helps

Regards

Vikas C

Read only

0 Likes
898

Hi Tanisha

The tables used in your report are tcdob,cdhdr,cdpos

and the fields used are

Table: tcdob

object

Table: cdhdr

objectid,username,udate,utime,udate,utime,changenr.

Table: cdpos

tabname,tabkey.

Read only

0 Likes
898

Close the thread if your problem is resolved