Application Development 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: 

Problem with Submit and Return statement

Former Member
0 Kudos

Hi Experts,

I have two reports.

First report has Select options as well as Parameters.

From Second Report i 'm passing set of values for select option and need to get back the results in the second Report.

But i'm getting only one value(which is the first value in the select option) in the second report.

Find the below code which i have used.

loop at s_matnr1.

seltab_wa-low = s_matnr1-low.

append seltab_wa to seltab.

endloop.

seltab_wa-selname = 'S_WERKS'.

seltab_wa-sign = 'I'.

seltab_wa-option = 'EQ'.

seltab_wa-low = wa_plant-werks.

append seltab_wa to seltab.

SUBMIT sdrqcr21 "VIA JOB jobname number jobcount AND RETURN

WITH SELECTION-TABLE seltab via selection-screen " IN s_matnr1

with P_INSERT EQ 'X'

WITH p_compar EQ ''

WITH p_lock EQ 'X'

WITH p_posins EQ 'X'

user sy-uname

via job jobname

number jobcount

and return.

i need all the values in the seltab should be executed rather than first value.

<removed by moderator>

Thanks in advance dudes

Regards,

Annamalai

Edited by: Thomas Zloch on Sep 15, 2011 1:48 PM

14 REPLIES 14

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

You're missing the KIND definition while populating the SELECION-TABLE

Read the F1 documentation you should be able to figure out the cause of your error.

BR,

Suhas

Former Member
0 Kudos

Suhas,

yes i will try with KIND = 'S'.

let you know for sure.

Regards,

Annamalai

Former Member
0 Kudos

Suhas,

i tried with KIND definition also..

still it returns first Material only.

Regards,

Annamalai.

Former Member
0 Kudos

add all the selection screen fields to SELTAB, that way you added to S_WERKS as below.

seltab_wa-selname = 'S_WERKS'.

seltab_wa-sign = 'I'.

seltab_wa-option = 'EQ'.

seltab_wa-low = wa_plant-werks.

append seltab_wa to seltab.

0 Kudos

Poorna,

I have added all the selection screen fields in the seltab.

but it didnt help.

Regards,

Annamalai.

former_member206439
Contributor
0 Kudos

Hi ,

Verify your code with the below code if there are any thing missing please add that or chnage .

*Code used to populate 'select-options' & execute report
DATA: seltab type table of rsparams,
      seltab_wa like line of seltab.

  seltab_wa-selname = 'PNPPERNR'.
  seltab_wa-sign    = 'I'.
  seltab_wa-option  = 'EQ'.

* load each personnel number accessed from the structure into
* parameters to be used in the report
  loop at pnppernr.
    seltab_wa-low = pnppernr-low.
    append seltab_wa to seltab.
  endloop.
  SUBMIT z_report_sample with selection-table seltab
                                                   via selection-screen.

former_member196064
Active Participant
0 Kudos

looks like you forgot seltab_wa-selname = 'S_MATNR' too.

Former Member
0 Kudos

hi,

Are you able to see all the plants?

Also I think you can solve very easily by debugging .

Just icheck f you have all the materials in the seltab at SUBMIT if not then definitely your code is incorrect in populating selection values.

Rhea.

0 Kudos

Rhea,

In debugging i can see all the plants as well as range of materials,

once it reaches selection screen of another report ,values are sitting in correct place.

for example

s_matnr has 7 material , plant has 1 plant

if i execute that report

1 plant 1 material is showing as result.

but i want 1 plant 7 materials as the output.

Regards,

Annamalai.

0 Kudos

Hello,

loop at s_matnr1.
seltab_wa-low = s_matnr1-low.
append seltab_wa to seltab.
endloop.

As already pointed out by Doug you're missing the SELNAME!

BR,

Suhas

0 Kudos

Suhas,

I have added selname before that...

sorry i missed that part of code since my main problem is with

submit and return statement.

Regards,

annamalai

0 Kudos

hi,

Did you run the report directly to see that there nothing wrong with the report ? I mean are you getting all the materials in o/p?

Rhea.

0 Kudos

Rhea,

My Requirement was like that..

i will schedule job based on the output...

If i get solution for the above mentioned code,

i can solve rest of the problem.

Regards,

Annamalai.

0 Kudos

Hi buddies,

At last my problem got resolved.

I have used Conversion exit for the Material number (S_MATNR) before submit and return statement.

it works fine.

Thank you so much for your reply

Regards,

Annamalai.