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

a sample coding for fun. module ' MRM_DBTAB_RSEG_READ' using subroutine

Former Member
0 Likes
553

i need to have this function module within the subroutine. something like this

perform item_detail using p_belnr p_gjahr changing i_irseg

loop at i_irseg.

write:/ i_irseg-belnr.

endloop.

form item_detail using p_belnr p_gjahr changing i_irseg

CALL FUNCTION 'MRM_DBTAB_RSEG_READ'

EXPORTING

I_BELNR = P_BELNR

I_GJAHR = P_GJAHR

  • I_BUFFER_ON = X

IMPORTING

TE_RSEG = I_IRSEG

EXCEPTIONS

ENTRY_NOT_FOUND = 1

OTHERS = 2.

this is not correct. Pls do provide the exact coding.

promise to reward points.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
505

Sample code.




report zrich_0004 .

type-pools: mrm.

data: i_irseg type mrm_tab_rseg.
data: x_irseg like line of i_irseg.

parameters: p_belnr type rseg-belnr,
            p_gjahr type rseg-gjahr.

start-of-selection.

  perform item_detail using p_belnr p_gjahr changing i_irseg.
<b>  loop at i_irseg into x_irseg.
    write:/ x_irseg-belnr.
  endloop.</b>



*---------------------------------------------------------------------*
*       FORM item_detail                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form item_detail using p_belnr p_gjahr changing i_irseg.

  call function 'MRM_DBTAB_RSEG_READ'
  exporting
       i_belnr = p_belnr
       i_gjahr = p_gjahr
* I_BUFFER_ON = X
  importing
       te_rseg = i_irseg
  exceptions
       entry_not_found = 1
       others = 2.

endform.


Regards,

Rich Heilman

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
506

Sample code.




report zrich_0004 .

type-pools: mrm.

data: i_irseg type mrm_tab_rseg.
data: x_irseg like line of i_irseg.

parameters: p_belnr type rseg-belnr,
            p_gjahr type rseg-gjahr.

start-of-selection.

  perform item_detail using p_belnr p_gjahr changing i_irseg.
<b>  loop at i_irseg into x_irseg.
    write:/ x_irseg-belnr.
  endloop.</b>



*---------------------------------------------------------------------*
*       FORM item_detail                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form item_detail using p_belnr p_gjahr changing i_irseg.

  call function 'MRM_DBTAB_RSEG_READ'
  exporting
       i_belnr = p_belnr
       i_gjahr = p_gjahr
* I_BUFFER_ON = X
  importing
       te_rseg = i_irseg
  exceptions
       entry_not_found = 1
       others = 2.

endform.


Regards,

Rich Heilman

Read only

Former Member
0 Likes
505

Hi Anitha,

Try this..

perform item_detail using p_belnr

p_gjahr

changing i_irseg.

loop at i_irseg.

write:/ i_irseg-belnr.

endloop.

form item_detail using p_belnr TYPE re_belnr

p_gjahr TYPE gjahr

changing i_irseg type TYPE MRM_TAB_RSEG.

CALL FUNCTION 'MRM_DBTAB_RSEG_READ'

EXPORTING

I_BELNR = P_BELNR

I_GJAHR = P_GJAHR

  • I_BUFFER_ON = X

IMPORTING

TE_RSEG = I_IRSEG

EXCEPTIONS

ENTRY_NOT_FOUND = 1

OTHERS = 2.

Read only

Former Member
0 Likes
505

Hi Anitha,

This code mentioned by you is OK and will work.