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

Code not working

Former Member
0 Likes
876

Hi All,

Please help me. The below code is not displaying the report.

AT SELECTION-SCREEN.

CASE sy-ucomm.

WHEN 'UACR'.

PERFORM PROCESS_UACR.

ENDCASE.

.

form PROCESS_UACR .

DATA: lt_dupreg_new TYPE TABLE OF zdvmt_dupreg WITH HEADER LINE,

ls_dupreg_new TYPE zdvmt_dupreg,

lt_irnum TYPE TABLE OF zdvmt_i_record WITH HEADER LINE,

lt_product TYPE TABLE OF zdvmt_product WITH HEADER LINE,

ls_email TYPE zdvmt_emailid.

SELECT * FROM zdvmt_dupreg

INTO TABLE lt_dupreg_new

WHERE acr = 'U'.

SORT lt_dupreg_new BY bpsetno .

FORMAT COLOR COL_POSITIVE.

WRITE: /1 'RECNO',

8 'SETNO',

17 'BPNO',

28 'BPGUID',

68 'FIRSTNAME',

88 'LASTNAME',

108 'BU_SORT1',

128 'BU_SORT2',

  • 148 'EMAIL',

148 'TELEPHONE1',

163 'TELEPHONE2',

178 'TELEPHONE3',

193 'COUNTRY',

201 'CreateUser',

218 'CreateDate',

235 'CreateTime',

250 'CHANGEDBY',

266 'CHANGEDDate',

284 'CHANGEDTIME',

300 'CIDNUMBER',

320 'ACR',

325 'SETCODE',

333 'EMAIL',

363 'STD_NO',

370 'PRODUCTGUID',

405 'PRODCUTNO',

420 'SERIALNO',

430 'CREATEDBY',

445 'CREATEDAT',

465 'IRNUMBER',

480 'CREATED_BY',

495 'CREATED_AT'.

SORT lt_dupreg_new BY bpsetno bpno.

LOOP AT lt_dupreg_new INTO ls_dupreg_new.

AT NEW BPSETNO.

FORMAT COLOR COL_BACKGROUND.

ENDAT.

WRITE: /1 ls_dupreg_new-recno,

8 ls_dupreg_new-bpsetno, 17 ls_dupreg_new-bpno, 28

ls_dupreg_new-bpguid, 68 ls_dupreg_new-firstname, 88

ls_dupreg_new-lastname,

108 ls_dupreg_new-bu_sort1, 128 ls_dupreg_new-bu_sort2,

148 ls_dupreg_new-phone1, 163

ls_dupreg_new-phone2, 178 ls_dupreg_new-phone3,

193 ls_dupreg_new-country, 201 ls_dupreg_new-crusr,

218 ls_dupreg_new-crdat, 235 ls_dupreg_new-crtim,

250 ls_dupreg_new-chusr, 266 ls_dupreg_new-chdat,

284 ls_dupreg_new-chtim, 300 ls_dupreg_new-cidnumber,

320 ls_dupreg_new-acr, 325 ls_dupreg_new-setcode.

lv_setno = ls_dupreg_new-bpsetno.

ENDLOOP.

ENDFORM.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
841

Hi,

U have written this code under the AT SELECTION-SCREEN event. So the system remains at selection-screen.

Write this code under START-OF-SELECTION or END-OF-SELECTION events.

Rewards points if helpful.

Regards,

Srinivas Ch

8 REPLIES 8
Read only

Former Member
0 Likes
841

zdvmt_dupreg does this table contain line with value acr = 'U'

Read only

Former Member
0 Likes
842

Hi,

U have written this code under the AT SELECTION-SCREEN event. So the system remains at selection-screen.

Write this code under START-OF-SELECTION or END-OF-SELECTION events.

Rewards points if helpful.

Regards,

Srinivas Ch

Read only

0 Likes
841

Hi Srinivas,

I need to handle the menu options from the selction screen only. I had written the FORM-----ENDFORM in start-of-selection only.

I think this is correct. But its not displaying any data.

Thanks for the help.

Anil,,,

Read only

Former Member
0 Likes
841

hi anil,

could u please mention the fields and their corresponding data elements present in zdvmt_dupreg ,zdvmt_i_record , zdvmt_product tables.

thanks

suma sailaja pvn

Read only

Former Member
0 Likes
841

hi

good

in this process it is not possible to give you the exact solution for your requiement , i would suggest you to debug the report and post the error that you are getting.

thanks

mrutyun^

Read only

Former Member
0 Likes
841

Hi,

Whenever you are using control break stmt like ATNEW ..ENDAT , The field should be the first field in the internal table.otherwise you will not get expected result in output.

LOOP AT lt_dupreg_new INTO ls_dupreg_new.

AT NEW BPSETNO.

FORMAT COLOR COL_BACKGROUND.

ENDAT.

Here you make code correction as bpsetno as first field in the internal table lt_dupreg_new so that you may get result.

just declare internal table and populate data like that.

Regds

Sivaparvathi

Please reward points if helpful...

Read only

Former Member
0 Likes
841

Hi ..

Check you code and change as follow.

First Define like this

TABLES :sscrfields.

AT SELECTION-SCREEN.

CASE sscrfields-ucomm. " should be change like this

WHEN 'UACR'.

PERFORM PROCESS_UACR.

ENDCASE.

Make sure in the Pf-Status you have created one push Button with 'UACR' function code.

Definetly it work. else send me the error you r getting.

regards

Swati namdeo

Read only

Former Member
0 Likes
841

Hi,

Though you have mentioned your form.....endform in the start-of-selection event you need to mention the perform statement also in start-of-sel event.

START-OF-SELECTION.

CASE sy-ucomm.

WHEN 'UACR'.

PERFORM PROCESS_UACR.

ENDCASE.

And also keep in mind, when you say at new (something)...

the rest of the fields in that internal table will get disabled.

so pass the fields into another internal table which is simalar to the one, and then use at nw command.

since you are saying at new... and then trying to print using write statement.

so, before using at new...pass the values to another int table and then print it.

Hope it is helpful.

Reward points if so.

Thanks,

Arul.