SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Print doc based on billing doc

Former Member
0 Kudos

hi,

I am looking FM which gives billing doc no based on print doc no or vice versa.

Thanks,

Sonar

1 ACCEPTED SOLUTION

former_member587072
Participant
0 Kudos

Hey Sonar ... FM's ISU_DB_ERCHC_SELECT_BILL and ISU_DB_ERCHC_SELECT_OPBEL will do the trick .... Joe

View solution in original post

4 REPLIES 4

former_member587072
Participant
0 Kudos

Hey Sonar ... FM's ISU_DB_ERCHC_SELECT_BILL and ISU_DB_ERCHC_SELECT_OPBEL will do the trick .... Joe

0 Kudos

Thanks Joe,

I need Fm , input is belnr( Billing doc) and output should be printdocumnet.

Thanks,

Sonar

0 Kudos

Hello Sonar,

Key o the solution is the DBERDLB table that holds both the print document and billing document number. IMHO there is no standard function module available that does the requested trick. I think that you will need to develop a FM by yourself.

Please mind the 'forward' relationship of a billing document with a print document. One print document may be related to more than one billing document.

Kind regards,

Fritz

former_member587072
Participant
0 Kudos

Hey Sonar ... As Fritz indicates, table DBERDLB definitely gives those relationships (as well as history say the invoice was reversed). If you only need the current information ... for example billing document 101 was on invoice 201 and it's reversed. Now billing document 101 is on invoice 202. Table ERCHC will give you the 101 to 202 relationship.

Pass FM ISU_DB_ERCHC_SELECT_BILL passing x_belnr = 101 and you'll receive table t_erchc with field opbel being 202.

I usually do a straight select but the FM should work fine.

Regards, Joe