cancel
Showing results for 
Search instead for 
Did you mean: 

Like to create a new report by Copying RCS15001(CS15 Tcode)?

former_member240010
Participant
0 Kudos

Hello,

I have 2 questions.

1)I would like have a new report which allows us to enter several material numbers and get the information, right now CS15 allows only one material to enter.

2) And I would like to add several new fields in the layouts for above new report created.

For this can I copy program RCS15001 and create new report, but I am not sure how to achieve to enter multiple material numbers and new fileds in the report. Please advice.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

peter_atkin
Active Contributor
0 Kudos

Mad Monk (nice name!!!)

Rather than copying CS15. create your own program that has a selection-screen field for materials.

Then loop through this list and call CS15 programatically.

Below is some of my own code from an old program.

PeteA


loop at gt_mattab into gw_mattab.

    export l_mode = c_e to memory id 'ALV_EXTRACT_MODE'.

* Call CS15 for aech material

    submit rcs15001

       with pm_idnrk = gw_mattab-matnr

       with pm_werks = gw_mattab-werks

       with pm_dirkt = c_x

       with pm_equtp = p_equnr

       with pm_tpltp = p_tplnr

       with pm_mattp = p_matnr

       and return.

*Import CS15 results

    clear gt_outtab_t.

    refresh gt_outtab_t.

    import it_outtab = gt_outtab_t from memory id 'ALV_EXTRACT_TABLE'.

    if sy-subrc <> 0.

      clear gw_outtab_t.

      gw_outtab_t-werks = gw_mattab-werks.

      gw_outtab_t-idnrk = gw_mattab-matnr.

      gw_outtab_t-bmtyp = c_n.

      gw_outtab_t-stlty = c_n.

      gw_outtab_t-objic = '@02@'.

      append gw_outtab_t to gt_outtab.

    endif.

    free memory id  'ALV_EXTRACT_MODE'.

    free memory id  'ALV_EXTRACT_TABLE'.

    loop at gt_outtab_t into gw_outtab_t.

      append gw_outtab_t to gt_outtab.

    endloop.

    clear gw_mattab.

  endloop.

former_member240010
Participant
0 Kudos

Thanks pete

MTerence
Active Contributor
0 Kudos

Hi,

I feel your query can be best handled in the Technical Forum.

Additionally, rather than copying the entire program, if you are able to find out the logic for your requirement like identify whether the material is used in Equipment BOm or Material etc, it will be very easy for your abaper to code.

A very good abaper will need only logic but some need table details and flow.

Regards

Terence