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

How to use Parallal Processing

Former Member
0 Likes
1,045

Hi All,

How to use Parallal processing in our report program, My report has to execute by forground. i have checked this bwlow link, they mentioned some small code here. but how to use and where to place this code in my report program.

http://help.sap.com/saphelp_nw70/helpdata/en/fa/096e92543b11d1898e0000e8322d00/content.htm

Thanks,

Subbu.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,009

Any body there to give the solution for this.

8 REPLIES 8
Read only

matt
Active Contributor
0 Likes
1,009

That link gives you all the information you need, including a fully annotated sample program. What more information do you want?

matt

Read only

Former Member
0 Likes
1,009

Hi Matthew ,

Thanks for your reply.

I have a one report, it will generate output list with interactive way. This is normal report contains 2000 lines. How to implement this parallal process in my report.

I could get how to use this process with the link information.

If you dont mind explain with small a program.

data kna1 like kna1 occurs 0 with header line.

select * from kna1 into table kna1.

data var type i.

loop at kna1.

var = var + 1.

write:/ kna1-kunnr.

if var = 1000.

exit.

endif.

endloop.

This is my sample program how to use this process in this program.

Thanks,

Subbu.

Read only

matt
Active Contributor
0 Likes
1,009

Your sample program is not really suitable for parallel processing. You need something that can be split into two or more independent processes.

matt

Read only

ThomasZloch
Active Contributor
0 Likes
1,009

In addition, the runtime of the overall process should be so critical that it warrants the extra effort and added complexity of the parallel approach.

Cheers

Thomas

Read only

Former Member
0 Likes
1,009

Ok...

Below is the some part of the program...If it possible to insert the parallal processing please let me know...It very urgent for me....

LOOP AT ITAB.

PERFORM MOVE_GR_AMTS_TO_ITAB.

PERFORM ET_IR_AMTS_FOR_PO_LINE.

PERFORM IGURE_COMMITMENTS_COOI.

MODIFY ITAB.

ENDLOOP.

FORM MOVE_GR_AMTS_TO_ITAB.

CLEAR GR_TAB.

MOVE-CORRESPONDING ITAB TO GR_KEY.

READ TABLE GR_TAB WITH KEY GR_KEY BINARY SEARCH.

IF SY-SUBRC = '0'.

ITAB-GR_QTY = GR_TAB-GR_QTY.

ITAB-GR_VALUE_CO = GR_TAB-GR_VALUE_CO.

ITAB-GR_VALUE_DOC = GR_TAB-GR_VALUE_DOC.

ITAB-GR_VALUE_LOC = GR_TAB-GR_VALUE_LOC.

ENDIF.

ENDFORM.

FORM GET_IR_AMTS_FOR_PO_LINE.

data : begin of EKBE occurs 0,

BUDAT like EKBE-BUDAT,

MENGE like EKBE-MENGE,

DMBTR like EKBE-DMBTR,

WRBTR like EKBE-WRBTR,

WAERS like EKBE-WAERS,

SHKZG like EKBE-SHKZG,

end of ekbe.

SELECT BUDAT MENGE DMBTR WRBTR WAERS SHKZG FROM EKBE into table EKBE WHERE EBELN = ITAB-PO_NO

AND EBELP = ITAB-LINE

AND VGABE EQ '2'

AND ZEKKN EQ ITAB-ZEKKN.

if sy-subrc is not initial.

exit.

endif.

loop at EKBE.

IF EKBE-SHKZG = 'H'.

ekbe-MENGE = EKBE-MENGE * -1.

ekbe-DMBTR = EKBE-DMBTR * -1.

ekbe-WRBTR = EKBE-WRBTR * -1.

ENDIF.

ITAB-IR_QTY = ITAB-IR_QTY + ekbe-MENGE.

ITAB-IR_VALUE_DOC = ITAB-IR_VALUE_DOC + ekbe-WRBTR.

ITAB-IR_VALUE_LOC = ITAB-IR_VALUE_LOC + ekbe-MBTR.

IF ITAB-CURR_PO = ITAB-CURR_CO.

ITAB-IR_VALUE_CO = ITAB-IR_VALUE_CO + ekbe-WRBTR.

ELSE.

GS_CONV_AMT = ekbe-WRBTR / GS_CORATE.

PERFORM GET_CURR_RATE USING ekbe-WAERS ekbe-BUDAT CHANGING GS_RATE.

ITAB-IR_VALUE_CO = ITAB-IR_VALUE_CO +

GS_CONV_AMT * GS_RATE.

ENDIF.

endloop.

ENDFORM.

FORM FIGURE_COMMITMENTS_COOI .

data : begin of COOI occurs 0,

WKGBTR like COOI-WKGBTR,

WTGBTR like COOI-WTGBTR,

WHGBTR like COOI-WHGBTR,

end of COOI.

SELECT WKGBTR WTGBTR WHGBTR FROM COOI into table COOI WHERE REFBT = '020'

AND REFBN = ITAB-PO_NO

AND RFPOS = ITAB-LINE

AND RFKNT = ITAB-ZEKKN.

if sy-subrc is not initial.

exit.

endif.

loop at COOI.

itab-COMMIT_CO = itab-COMMIT_CO + COOI-WKGBTR.

itab-COMMIT_DOC = itab-COMMIT_DOC + COOI-WTGBTR.

itab-COMMIT_LOC = itab-COMMIT_LOC + COOI-WHGBTR.

endloop.

ENDFORM.

Thanks...

Read only

Former Member
0 Likes
1,010

Any body there to give the solution for this.

Read only

0 Likes
1,009

Any body there to give the solution for this.

Read only

0 Likes
1,009

Hi ,

Get the basic requirement of using the PArallel processing.

You can use the parallel processing with only Function modules(RFC only).

You can call this fm's in parallel processing, inside a loop.

Now for your case, if you want to improve the performance of your program by implementing the Parallel processing, first get the logic moved inside a FM(rfc) and then use the fm like below

CALL FUNCTION 'XXXX'

IN NEW TASK <task name>

DESTINATION <destination name>.......

I hope you have seen the help , if still u have some doubts in using this plz post again, may be i will try to clear you

Regards

Sunil kumar P