cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Forms: Document Type

Former Member
0 Kudos
98

Hi all,

I am trying to set a search define up that works on all sales forms, rather than create an alternate one for each form. I know I can get access to generic sections of the form using the following:

$[$4.0.0]

Which I know can get me the BP code for example, but I wish to extract the document type from the form, does anyone know if this is possible? or what number I would be after?

I know that $[$1.0.0] is the add/update button for example, the few numbers I have tried haven't yielded the correct results....

Is the a guide or list that contains these references??

All help is much appreciated.

Kind Regards

Matthew

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

Hi Matthew,

Here is what I got for you. The Series held the secret to the solution

SELECT T0.OBJECTCODE FROM [DBO].[NNM1] T0

WHERE T0.SERIES = $[$88.1]

OR

SELECT CASE

WHEN T0.OBJECTCODE = 23 THEN 'OQUT'

WHEN T0.OBJECTCODE = 17 THEN 'ORDR'

WHEN T0.OBJECTCODE = 15 THEN 'ODLN'

WHEN T0.OBJECTCODE = 16 THEN 'ORDN'

WHEN T0.OBJECTCODE = 13 THEN 'OINV'

WHEN T0.OBJECTCODE = 14 THEN 'ORIN'

END

FROM [DBO].[NNM1] T0

WHERE T0.SERIES = $[$88.1]

Best Wishes

Suda

Former Member
0 Kudos

Hi,

Thanks, works great and is exactly what I need...

Now off to code my queries...

Many Thanks

Matthew

Answers (1)

Answers (1)

john_treweeks
Participant
0 Kudos

Hi Matthew,

You can get SAP business one to tell you the numbers involved by switching this on. then you simply roll over the field and it displays the numbers in the bottom left of the screen.

go to: View> System information

Now when you hover over a field for example BP code, you will see "[Form=139 Item = 4 variable = 1 ORDR, CardCode

the number you are interested in is the item number (4). That is how you get $[$4.0.0] for cardcode.

Also note that ORDR is the table this field is stored in and the fields is named CardCode in that table.

If you want to reference a row item you will need the Column number so for Item Number (item 38) you want $[$38.1.0] the '1' here is the column number when you hover over the item number.

Check it out, have a go, and if you have any questions, reply to this thread and i will see if i can help you out.

Cheers

John Treweeks

Former Member
0 Kudos

Hi,

Thanks for your response, unfortunately I don't think I discribed what I am after too well...

I am trying to write a query the will work on all sales forms but access UDF information rather then create six different queries to do the same thing. So what I am after is adding a form, then checking a forms type ie. Sales order/delivery note and then responding by grabbing the correct UDF, unless there is a way of accessing UDF's other then like this $[ODLN.UDFNAME] as this will get it for a delivery note but not a sales order.

I need something like:

SELECT CASE FORMTYPE WHEN 'SO' THEN $[ORDR.UDF] WHEN 'DN' THEN $[ODLN.UDF] ELSE '' END FROM $[$FORMTYPE]

I know you can get the information from a saved form as thats recorded in the database as ObjType, i.e Sales Order is 17, Delivery Note is 15. But my interest is a form creation level not from saved data...I would like to know if there is a way to get this from the form itself...

Unless of course there is another you can get $[ODLN.UDFNAME] without specifying the form name...

I'd prefer a way of doing this mainly from the maintanence of query side in case we wanted/needed to alter the query - its easier to alter 1, than 6 etc..

Kind Regards

Matthew