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

MB5S Report

Former Member
0 Likes
1,255

Hi,

I need to write a report that shows status of internal order where there will have several open PO.

In this report, I will also need to show Open Accural for the PO. I've told that I can go to trx MB5S to get the list of Open Accural PO. I've looked into the report program RM07MSAL to get some idea of how it retrieve the data. Unfortunally, it's quite complicated, and there are few enhancement added for this program.

My questions is, is there an easier way to get the list of PO from this standard SAP report, and plug it into my report?

Thanks.

Lily

Edited by: Lily Wu on Aug 1, 2008 5:08 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,025

Hi,

Try this code:

DATA: ABAPLIST LIKE ABAPLIST OCCURS 0.

data: begin of it_lin occurs 0,

line(120) type c,

end of it_lin.

submit RM07MSAL EXPORTING LIST TO MEMORY

AND RETURN

with ...... "parameters

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = ABAPLIST

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

  • LIST_INDEX = -1

WITH_LINE_BREAK = 'X'

  • IMPORTING

  • LIST_STRING_ASCII =

TABLES

LISTASCI = it_lin

LISTOBJECT = ABAPLIST

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at it_lin .

*Take the values here

endloop.

Points apreciated

Hi,

I need to write a report that shows status of internal order where there will have several open PO.

In this report, I will also need to show Open Accural for the PO. I've told that I can go to trx MB5S to get the list of Open Accural PO. I've looked into the report program RM07MSAL to get some idea of how it retrieve the data. Unfortunally, it's quite complicated, and there are few enhancement added for this program.

My questions is, is there an easier way to get the list of PO from this standard SAP report, and plug it into my report?

Thanks.

Lily

Edited by: Lily Wu on Aug 1, 2008 5:08 PM

3 REPLIES 3
Read only

Former Member
0 Likes
1,026

Hi,

Try this code:

DATA: ABAPLIST LIKE ABAPLIST OCCURS 0.

data: begin of it_lin occurs 0,

line(120) type c,

end of it_lin.

submit RM07MSAL EXPORTING LIST TO MEMORY

AND RETURN

with ...... "parameters

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = ABAPLIST

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2.

CALL FUNCTION 'LIST_TO_ASCI'

EXPORTING

  • LIST_INDEX = -1

WITH_LINE_BREAK = 'X'

  • IMPORTING

  • LIST_STRING_ASCII =

TABLES

LISTASCI = it_lin

LISTOBJECT = ABAPLIST

EXCEPTIONS

EMPTY_LIST = 1

LIST_INDEX_INVALID = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

loop at it_lin .

*Take the values here

endloop.

Points apreciated

Read only

0 Likes
1,025

Thank you for your repsonse.

I tried the program, and it gives me the list of all the data in the list format with lines and spaces etc.

I assume that I can loop through this list, and try to get rid of unwanted lines and space.

I'm not sure that if there is any other easier way to get all the data from the list (without the dashes, etc).

Thanks.

Lily

Read only

0 Likes
1,025

Hi,

Yes you can loop through this list, and try to get rid of unwanted lines and space.

You have an internal table with all the data.