A Research Study of a New Medicine NNC0519-0130 in Healthy People, People With High Body Weight and People With Type 2 Diabetes.

NNC0519-0130 is a new medicine which may possibly help participants with type 2 diabetes, as it is expected to lower elevated sugar levels in the blood. The medicine may also lower the appetite. This could help reducing overweight which is often present in participants with type 2 diabetes. In this study NNC0519-0130 is given to humans for the first time. This study will be looking into how safe the new medicine NNC0519-0130 is and will measure its concentrations in the blood. Moreover, effects on blood sugar, blood fat and body weight will be tested. There are different study parts with different participants. Healthy participants (men), healthy participants (men) with high body weight and people with diabetes (men and women) take part. Single doses and multiple doses are tested and the medicine is studied as an injection or when given orally (as a tablet). The participants are invited to take part in a part of the study which will look at the effects of weekly injected doses of NNC0519-0130 taken over the course of several weeks. It is planned that participants will be given the study medicine once weekly. The dose will be increased every three weeks, if safety and tolerability allow. Participants will take up to six different dose levels. This means that the period with weekly injections of study medicine will in total last up to 18 weeks. Participants will either get the study medicine NNC0519-0130 or placebo (a 'dummy' medicine that looks like the medicines but without any active medicine). Which medicine participant gets is decided by chance. The injection of study medicine will be done by trained staff into the tissue underneath the skin of belly using a syringe and needle. The total duration of the study could last up to 25 weeks.


Eligibility Criteria:
Inclusion Criteria:

* Single ascending dose (SAD) part:
* Male aged 18-55 years (both inclusive) at screening
* Body mass index between 18.5 kilogram per meter square (kg/m\^2) and 27.0 kg/m\^2 (both inclusive) at screening
* Considered to be generally healthy based on the medical history, physical examination, and the results of vital signs, electrocardiogram and clinical laboratory tests performed during the screening visit, as judged by the investigator
* Multiple ascending dose (MAD) part (MAD QD and MAD QW):
* Male aged 18-55 years (both inclusive) at screening
* Body mass index between 25.0 kg/m\^2 and 39.9 kg/m\^2 (both inclusive) at screening. Overweight should be due to excess adipose tissue, as judged by the investigator
* Considered eligible based on the medical history, physical examination, and the results of vital signs, electrocardiogram and clinical laboratory tests performed during the screening visit, as judged by the investigator
* Type 2 diabetes (T2D) part:
* Female of non-childbearing potential or male aged 18-64 years (both inclusive) at screening
* Body mass index between 25.0 kg/m\^2 and 39.9 kg/m\^2 (both inclusive) at screening
* Diagnosed with type 2 diabetes mellitus greater than or equal to (≥) 180 days before screening
* Treatment naive to antidiabetic drugs or on a stable daily dose(s) of metformin therapy (any metformin formulation any dose) greater than or equal to (\>=) 60 days before screening
* Insulin naive. However, short-term insulin treatment for a maximum of 14 days before screening is allowed, as is prior insulin treatment for gestational diabetes
* HbA1c in the range of 6.5% (inclusive) and 9.5% (inclusive)

Exclusion Criteria:

* Single ascending dose (SAD) part:
* Any disorder, which in the investigator's opinion might jeopardise participant's safety or compliance with the protocol
* Glycosylated haemoglobin (HbA1c) greater than or equal to (≥) 6.5 % (48 millimoles per mole (mmol/mol)) at screening
* Use of prescription medicinal products or non-prescription drugs, except routine vitamins, occasional use of paracetamol, ibuprofen, acetylsalicylic acid, and domperidon, or topical medication not reaching systemic circulation, within 14 days before screening
* Any disorder, which in the investigator's opinion might jeopardise participant's safety or compliance with the protocol
* Presence or history of any clinically relevant respiratory, metabolic, renal, hepatic, cardiovascular, gastrointestinal, or endocrinological conditions
* HbA1c greater than or equal to (≥) 6.5 % (48 mmol/mol) at screening
* Use of prescription medicinal products or non-prescription drugs, except routine vitamins, occasional use of paracetamol, ibuprofen, acetylsalicylic acid, and domperidon, or topical medication not reaching systemic circulation, within 14 days before screening
* Multiple ascending dose (MAD) part (MAD QD and MAD QW):
* Any disorder, which in the investigator's opinion might jeopardise participant's safety or compliance with the protocol
* Presence or history of any clinically relevant respiratory, metabolic, renal, hepatic, cardiovascular, gastrointestinal, or endocrinological conditions
* HbA1c greater than or equal to (≥) 6.5 % (48 mmol/mol) at screening
* Use of prescription medicinal products or non-prescription drugs, except routine vitamins, occasional use of paracetamol, ibuprofen, acetylsalicylic acid, and domperidon, or topical medication not reaching systemic circulation, within 14 days before screening
* Type 2 diabetes (T2D) part:
* Any disorder, except for conditions associated with T2D, which in the investigator's opinion might jeopardise participant's safety or compliance with the protocol
* Presence or history of any clinically relevant respiratory, metabolic, renal, hepatic, gastrointestinal, endocrinological conditions (except conditions associated with diabetes mellitus)
* Current treatment with systemically effective corticosteroids, monoamine oxidase (MAO) inhibitors, systemic non-selective beta-blockers, growth hormone, non-routine vitamins or herbal products
* Current treatment with selected oral medication with a narrow therapeutic window, such as warfarin, digoxin, tricyclic antidepressants, lithium, aminophylline, theophylline and anticonvulsants